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 int
available()
int
read()
int
read(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:
read
in classInputStream
-
read
public int read(byte[] bytes, int off, int len)
- Overrides:
read
in classInputStream
-
available
public int available()
- Overrides:
available
in classInputStream
-
-