List of usage examples for io.netty.buffer ByteBuf getIntLE
public abstract int getIntLE(int index);
From source file:org.traccar.protocol.RetranslatorFrameDecoder.java
License:Apache License
@Override protected Object decode(ChannelHandlerContext ctx, Channel channel, ByteBuf buf) throws Exception { int length = 4 + buf.getIntLE(buf.readerIndex()); if (buf.readableBytes() >= length) { return buf.readRetainedSlice(length); } else {/* www . j a va 2 s. c om*/ return null; } }