Package io.netty.buffer

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


    return toFMLPacket(msg, MainProxy.networkChannelName);
  }
 
  private static FMLProxyPacket toFMLPacket(ModernPacket msg, String channel) throws Exception {
    ByteBuf buffer = Unpooled.buffer();
    buffer.writeShort(msg.getId());
    buffer.writeInt(msg.getDebugId());
    msg.writeData(new LPDataOutputStream(buffer));
    return new FMLProxyPacket(buffer.copy(), channel);
  }
View Full Code Here


        long cas = System.currentTimeMillis();

        ByteBuf buffer = Unpooled.buffer();
        buffer.writeByte(magic);
        buffer.writeByte(opCode);
        buffer.writeShort(key.length);
        buffer.writeByte(0);
        buffer.writeByte(dataType);
        buffer.writeShort(Status.KEY_EXISTS);
        buffer.writeInt(body.length + key.length);
        buffer.writeInt(id);
View Full Code Here

        buffer.writeByte(magic);
        buffer.writeByte(opCode);
        buffer.writeShort(key.length);
        buffer.writeByte(0);
        buffer.writeByte(dataType);
        buffer.writeShort(Status.KEY_EXISTS);
        buffer.writeInt(body.length + key.length);
        buffer.writeInt(id);
        buffer.writeLong(cas);
        buffer.writeBytes(key);
        buffer.writeBytes(body);
View Full Code Here

        long cas = System.currentTimeMillis();

        ByteBuf buffer = Unpooled.buffer();
        buffer.writeByte(magic);
        buffer.writeByte(opCode);
        buffer.writeShort(key.length);
        buffer.writeByte(0);
        buffer.writeByte(dataType);
        buffer.writeShort(Status.KEY_EXISTS);
        buffer.writeInt(body.length + key.length);
        buffer.writeInt(id);
View Full Code Here

        buffer.writeByte(magic);
        buffer.writeByte(opCode);
        buffer.writeShort(key.length);
        buffer.writeByte(0);
        buffer.writeByte(dataType);
        buffer.writeShort(Status.KEY_EXISTS);
        buffer.writeInt(body.length + key.length);
        buffer.writeInt(id);
        buffer.writeLong(cas);
        buffer.writeBytes(key);
        buffer.writeBytes(body);
View Full Code Here

    ByteBuf data = Unpooled.buffer();

    pageNum = (short) (page | (maxPages << 8));
    this.data = buf;
    data.writeInt( getPacketID() );
    data.writeShort( pageNum );
    data.writeBytes( buf );

    configureWrite( data );
  }
View Full Code Here

    this.value = value;

    ByteBuf data = Unpooled.buffer();

    data.writeInt( getPacketID() );
    data.writeShort( short_id );
    data.writeLong( value );

    configureWrite( data );
  }
}
View Full Code Here

    private ByteBuf encodeResponse(ResponseSocketBlock resMsg) {
        ByteBuf bodyBuf = ByteBufAllocator.DEFAULT.heapBuffer();
        //
        //* --------------------------------------------------------bytes =8
        //* byte[2]  status                               响应状态
        bodyBuf.writeShort(resMsg.getStatus());
        //* byte[2]  serializeType-(attr-index)           序列化策略
        bodyBuf.writeShort(resMsg.getSerializeType());
        //* byte[2]  returnType-(attr-index)              返回类型
        bodyBuf.writeShort(resMsg.getReturnType());
        //* byte[2]  returnData-(attr-index)              返回数据
View Full Code Here

        //
        //* --------------------------------------------------------bytes =8
        //* byte[2]  status                               响应状态
        bodyBuf.writeShort(resMsg.getStatus());
        //* byte[2]  serializeType-(attr-index)           序列化策略
        bodyBuf.writeShort(resMsg.getSerializeType());
        //* byte[2]  returnType-(attr-index)              返回类型
        bodyBuf.writeShort(resMsg.getReturnType());
        //* byte[2]  returnData-(attr-index)              返回数据
        bodyBuf.writeShort(resMsg.getReturnData());
        //* --------------------------------------------------------bytes =1 ~ 1021
View Full Code Here

        //* byte[2]  status                               响应状态
        bodyBuf.writeShort(resMsg.getStatus());
        //* byte[2]  serializeType-(attr-index)           序列化策略
        bodyBuf.writeShort(resMsg.getSerializeType());
        //* byte[2]  returnType-(attr-index)              返回类型
        bodyBuf.writeShort(resMsg.getReturnType());
        //* byte[2]  returnData-(attr-index)              返回数据
        bodyBuf.writeShort(resMsg.getReturnData());
        //* --------------------------------------------------------bytes =1 ~ 1021
        //* byte[1]  optionCount                          选项参数总数
        int[] optionMapping = resMsg.getOptions();
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.