Fixing 4 vs 8 byte payload length testing issue

This commit is contained in:
Joakim Erdfelt 2012-06-26 12:29:57 -07:00
parent 888314e08a
commit 4eeb433b44
1 changed files with 3 additions and 3 deletions

View File

@ -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();