- * Note: the underlying payload is merely a {@link ByteBuffer#slice()} of the input frame.
- *
- * @param copy
- * the websocket to copy.
- */
- public WebSocketFrame(WebSocketFrame copy)
- {
- fin = copy.rsv1;
- rsv1 = copy.rsv2;
- rsv2 = copy.rsv2;
- rsv3 = copy.rsv3;
- opcode = copy.opcode;
- masked = copy.masked;
- mask = null;
- if (copy.mask != null)
- {
- mask = new byte[copy.mask.length];
- System.arraycopy(copy.mask,0,mask,0,mask.length);
- }
- data = copy.data.slice();
- continuationIndex = copy.continuationIndex;
- continuation = copy.continuation;
- }
-
public void assertValid()
{
if (opcode.isControlFrame())
@@ -371,6 +341,7 @@ public class WebSocketFrame implements Frame
BufferUtil.clearToFill(data);
data.put(buf,0,len);
BufferUtil.flipToFlush(data,0);
+ BufferUtil.flipToFill(data);
return this;
}
@@ -399,7 +370,7 @@ public class WebSocketFrame implements Frame
data = ByteBuffer.allocate(len);
BufferUtil.clearToFill(data);
data.put(buf,0,len);
- BufferUtil.flipToFlush(data,0);
+ BufferUtil.flipToFill(data);
return this;
}
diff --git a/pom.xml b/pom.xml
index 5586dd0a5e5..41f8e23fc46 100644
--- a/pom.xml
+++ b/pom.xml
@@ -355,6 +355,7 @@