Package io.netty.buffer

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


        };
       
        ByteBuf buf = channel.alloc().buffer(2 + 2 + data.length).order(ByteOrder.LITTLE_ENDIAN);
       
        // write the header
        buf.writeShort(18);
       
        // write length of the data in ints
        buf.writeShort(data.length / 4);
       
        for (int i = 0; i < data.length; i++)
View Full Code Here


       
        // write the header
        buf.writeShort(18);
       
        // write length of the data in ints
        buf.writeShort(data.length / 4);
       
        for (int i = 0; i < data.length; i++)
        {
            buf.writeByte(data[i]);
        }
View Full Code Here

    try {
      TileEntity tile = pipe.container;

      // In order to save space on message, we assuming dimensions ids
      // small. Maybe worth using a varint instead
      data.writeShort(tile.getWorldObj().provider.dimensionId);
      data.writeInt(tile.xCoord);
      data.writeInt(tile.yCoord);
      data.writeInt(tile.zCoord);

      writeParameters(method, data, actuals);
View Full Code Here

    public void testUnexpectedBlockIdentifier() throws Exception {
        expected.expect(DecompressionException.class);
        expected.expectMessage("unexpected block identifier");

        ByteBuf in = Unpooled.buffer();
        in.writeShort(0x1234)//random value
        in.writeByte(BLOCK_TYPE_NON_COMPRESSED);
        in.writeShort(0);

        channel.writeInbound(in);
    }
View Full Code Here

        expected.expectMessage("unexpected block identifier");

        ByteBuf in = Unpooled.buffer();
        in.writeShort(0x1234)//random value
        in.writeByte(BLOCK_TYPE_NON_COMPRESSED);
        in.writeShort(0);

        channel.writeInbound(in);
    }

    @Test
View Full Code Here

        }

        // SPDY RST_STREAM Frame
        frames.writeByte(0x80);
        frames.writeByte(version);
        frames.writeShort(3);
        frames.writeInt(8);
        frames.writeInt(random.nextInt() & 0x7FFFFFFF | 0x01);
        frames.writeInt(random.nextInt() | 0x01);

        // SPDY SETTINGS Frame
View Full Code Here

        frames.writeInt(random.nextInt() | 0x01);

        // SPDY SETTINGS Frame
        frames.writeByte(0x80);
        frames.writeByte(version);
        frames.writeShort(4);
        frames.writeByte(0x01);
        frames.writeMedium(12);
        frames.writeInt(1);
        frames.writeByte(0x03);
        frames.writeMedium(random.nextInt());
View Full Code Here

        frames.writeInt(random.nextInt());

        // SPDY PING Frame
        frames.writeByte(0x80);
        frames.writeByte(version);
        frames.writeShort(6);
        frames.writeInt(4);
        frames.writeInt(random.nextInt());

        // SPDY GOAWAY Frame
        frames.writeByte(0x80);
View Full Code Here

        frames.writeInt(random.nextInt());

        // SPDY GOAWAY Frame
        frames.writeByte(0x80);
        frames.writeByte(version);
        frames.writeShort(7);
        frames.writeInt(8);
        frames.writeInt(random.nextInt() & 0x7FFFFFFF);
        frames.writeInt(random.nextInt() | 0x01);

        // SPDY HEADERS Frame
View Full Code Here

        frames.writeInt(random.nextInt() | 0x01);

        // SPDY HEADERS Frame
        frames.writeByte(0x80);
        frames.writeByte(version);
        frames.writeShort(8);
        frames.writeByte(0x01);
        frames.writeMedium(4);
        frames.writeInt(random.nextInt() & 0x7FFFFFFF | 0x01);

        // SPDY WINDOW_UPDATE Frame
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.