Fixing 4 vs 8 byte payload length testing issue
This commit is contained in:
parent
888314e08a
commit
4eeb433b44
|
@ -61,10 +61,10 @@ public class TextPayloadParserTest
|
|||
|
||||
Assert.assertThat("Must be a long length payload",utf.length,greaterThan(0xFFFF));
|
||||
|
||||
ByteBuffer buf = ByteBuffer.allocate(utf.length + 10);
|
||||
ByteBuffer buf = ByteBuffer.allocate(utf.length + 32);
|
||||
buf.put((byte)0x81);
|
||||
buf.put((byte)(0x80 | 0x7F)); // 0x7F == 127 (a 4 byte payload length)
|
||||
buf.putInt(utf.length);
|
||||
buf.put((byte)(0x80 | 0x7F)); // 0x7F == 127 (a 8 byte payload length)
|
||||
buf.putLong(utf.length);
|
||||
MaskedByteBuffer.putMask(buf);
|
||||
MaskedByteBuffer.putPayload(buf,utf);
|
||||
buf.flip();
|
||||
|
|
Loading…
Reference in New Issue