Package gaiasky.util.io
Class ByteBufferInputStream
java.lang.Object
java.io.InputStream
gaiasky.util.io.ByteBufferInputStream
- All Implemented Interfaces:
Closeable
,AutoCloseable
-
Constructor Summary
ConstructorDescriptionByteBufferInputStream
(int bufferSize) Creates a stream with a new non-direct buffer of the specified size.ByteBufferInputStream
(ByteBuffer byteBuffer) Creates an uninitialized stream that cannot be used untilsetByteBuffer(ByteBuffer)
is called. -
Method Summary
Modifier and TypeMethodDescriptionint
int
read()
int
read
(byte[] bytes, int offset, int length) void
setByteBuffer
(ByteBuffer byteBuffer) Methods inherited from class java.io.InputStream
close, mark, markSupported, nullInputStream, read, readAllBytes, readNBytes, readNBytes, reset, skip, skipNBytes, transferTo
-
Constructor Details
-
ByteBufferInputStream
public ByteBufferInputStream() -
ByteBufferInputStream
public ByteBufferInputStream(int bufferSize) Creates a stream with a new non-direct buffer of the specified size. The position and limit of the buffer is zero. -
ByteBufferInputStream
Creates an uninitialized stream that cannot be used untilsetByteBuffer(ByteBuffer)
is called.
-
-
Method Details
-
getByteBuffer
-
setByteBuffer
-
read
- Specified by:
read
in classInputStream
- Throws:
IOException
-
read
- Overrides:
read
in classInputStream
- Throws:
IOException
-
available
- Overrides:
available
in classInputStream
- Throws:
IOException
-