Package io.netty.buffer

Examples of io.netty.buffer.ByteBuf.writeLong()


    public void testUnexpectedStreamIdentifier() throws Exception {
        expected.expect(DecompressionException.class);
        expected.expectMessage("Unexpected stream identifier contents");

        ByteBuf in = Unpooled.buffer();
        in.writeLong(1823080128301928729L); //random value

        channel.writeInbound(in);
    }

    @Test
View Full Code Here


                    size += length;
                }
                buf = ctx.alloc().buffer(size);
                buf.writeByte(b0);
                buf.writeByte(maskPayload ? 0xFF : 127);
                buf.writeLong(length);
            }

            // Write payload
            if (maskPayload) {
                int random = (int) (Math.random() * Integer.MAX_VALUE);
 
View Full Code Here

                           BEGINNING_SPACE.matcher(key2).replaceAll("").length());
            long c = req.content().readLong();
            ByteBuf input = Unpooled.buffer(16);
            input.writeInt(a);
            input.writeInt(b);
            input.writeLong(c);
            res.content().writeBytes(WebSocketUtil.md5(input.array()));
        } else {
            // Old Hixie 75 handshake getMethod with no challenge:
            res.headers().add(HttpHeaderNames.WEBSOCKET_ORIGIN, req.headers().get(HttpHeaderNames.ORIGIN));
            res.headers().add(HttpHeaderNames.WEBSOCKET_LOCATION, uri());
View Full Code Here

        byte flags = (byte) 0xFF;
        int length = 8;

        ByteBuf buf = ReferenceCountUtil.releaseLater(Unpooled.buffer(SPDY_HEADER_SIZE + length));
        encodeControlFrameHeader(buf, type, flags, length);
        buf.writeLong(RANDOM.nextLong());

        replay(delegate);
        decoder.decode(buf);
        verify(delegate);
        assertFalse(buf.isReadable());
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.