Package io.netty.buffer

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


        assertArrayEquals("Three byte short written", new byte[] { -128, 0, 1}, buf.array());
        assertEquals("Three byte short written", 3, buf.readableBytes());

        buf.clear();
        buf.writeZero(3);
        buf.clear();
        buf.writeShort(-32768);
        buf.writeByte(1);
        val = ByteBufUtils.readVarShort(buf);
        assertEquals("Three byte short read correctly", 32768, val);
View Full Code Here


        buf.writeShort(-32768);
        buf.writeByte(1);
        val = ByteBufUtils.readVarShort(buf);
        assertEquals("Three byte short read correctly", 32768, val);

        buf.clear();
        buf.writeZero(3);
        buf.clear();

        ByteBufUtils.writeVarShort(buf, 8388607);
        assertArrayEquals("Three byte short written", new byte[] { -1, -1, -1}, buf.array());
View Full Code Here

        val = ByteBufUtils.readVarShort(buf);
        assertEquals("Three byte short read correctly", 32768, val);

        buf.clear();
        buf.writeZero(3);
        buf.clear();

        ByteBufUtils.writeVarShort(buf, 8388607);
        assertArrayEquals("Three byte short written", new byte[] { -1, -1, -1}, buf.array());
        assertEquals("Three byte short written", 3, buf.readableBytes());
View Full Code Here

        ByteBufUtils.writeVarShort(buf, 8388607);
        assertArrayEquals("Three byte short written", new byte[] { -1, -1, -1}, buf.array());
        assertEquals("Three byte short written", 3, buf.readableBytes());

        buf.clear();
        buf.writeZero(3);
        buf.clear();
        buf.writeShort(-1);
        buf.writeByte(-1);
        val = ByteBufUtils.readVarShort(buf);
View Full Code Here

        assertArrayEquals("Three byte short written", new byte[] { -1, -1, -1}, buf.array());
        assertEquals("Three byte short written", 3, buf.readableBytes());

        buf.clear();
        buf.writeZero(3);
        buf.clear();
        buf.writeShort(-1);
        buf.writeByte(-1);
        val = ByteBufUtils.readVarShort(buf);
        assertEquals("Three byte short read correctly", 8388607, val);
    }
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.