Java Code Examples for io.netty.buffer.ByteBuf.readShortLE()

The following are Jave code examples for showing how to use readShortLE() of the io.netty.buffer.ByteBuf class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: JungleTree   File: ResourcePackResponseCodec.java   Source Code and License Vote up 5 votes
@Override
public ResourcePackResponsePacket decode(ByteBuf buf) {
    ResourcePackResponsePacket packet = new ResourcePackResponsePacket();
    packet.setStatus(ResourcePackStatus.fromOrdinal(buf.readByte()));

    String[] packs = new String[buf.readShortLE()];
    for (int i=0; i<packs.length; i++) {
        packs[i] = ByteBufUtils.readString(buf);
    }
    packet.setPacksToDownload(packs);

    return packet;
}