修复ByteBuffer的缓存区域会重复的BUG

This commit is contained in:
Redkale
2017-08-28 17:50:09 +08:00
parent 2005bf7e3b
commit fcff1c3a4b

View File

@@ -112,7 +112,7 @@ public final class WebSocketPacket {
ByteBuffer[] duplicateSendBuffers() { ByteBuffer[] duplicateSendBuffers() {
ByteBuffer[] rs = new ByteBuffer[this.sendBuffers.length]; ByteBuffer[] rs = new ByteBuffer[this.sendBuffers.length];
for (int i = 0; i < this.sendBuffers.length; i++) { for (int i = 0; i < this.sendBuffers.length; i++) {
rs[i] = this.sendBuffers[i].duplicate(); rs[i] = this.sendBuffers[i].duplicate().asReadOnlyBuffer();
} }
return rs; return rs;
} }