Example usage for io.netty.buffer ByteBuf getIntLE

List of usage examples for io.netty.buffer ByteBuf getIntLE

Introduction

In this page you can find the example usage for io.netty.buffer ByteBuf getIntLE.

Prototype

public abstract int getIntLE(int index);

Source Link

Document

Gets a 32-bit integer at the specified absolute index in this buffer with Little Endian Byte Order.

Usage

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;
    }
}