Package org.apache.druid.io
Class ByteBufferInputStream
- java.lang.Object
-
- java.io.InputStream
-
- org.apache.druid.io.ByteBufferInputStream
-
- All Implemented Interfaces:
Closeable,AutoCloseable
public final class ByteBufferInputStream extends InputStream
Streams bytes from theByteBuffer's position to the limit asInputStream.
-
-
Constructor Summary
Constructors Constructor Description ByteBufferInputStream(ByteBuffer buffer)Does *not* make a copy of the given buffer, so the position of the given buffer is incremented, as the created InputStream is used.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intavailable()intread()intread(byte[] bytes, int off, int len)-
Methods inherited from class java.io.InputStream
close, mark, markSupported, nullInputStream, read, readAllBytes, readNBytes, readNBytes, reset, skip, transferTo
-
-
-
-
Constructor Detail
-
ByteBufferInputStream
public ByteBufferInputStream(ByteBuffer buffer)
Does *not* make a copy of the given buffer, so the position of the given buffer is incremented, as the created InputStream is used.
-
-
Method Detail
-
read
public int read()
- Specified by:
readin classInputStream
-
read
public int read(byte[] bytes, int off, int len)- Overrides:
readin classInputStream
-
available
public int available()
- Overrides:
availablein classInputStream
-
-