Class ByteBufInputStream

java.lang.Object
java.io.InputStream
io.netty.buffer.ByteBufInputStream
All Implemented Interfaces:
Closeable, DataInput, AutoCloseable

public class ByteBufInputStream extends InputStream implements DataInput
An InputStream which reads data from a ByteBuf.

A read operation against this stream will occur at the readerIndex of its underlying buffer and the readerIndex will increase during the read operation. Please note that it only reads up to the number of readable bytes determined at the moment of construction. Therefore, updating ByteBuf.writerIndex() will not affect the return value of available().

This stream implements DataInput for your convenience. The endianness of the stream is not always big endian but depends on the endianness of the underlying buffer.

See Also: