Package nom.tam.util
Class ByteBufferInputStream
java.lang.Object
java.io.InputStream
nom.tam.util.ByteBufferInputStream
- All Implemented Interfaces:
Closeable
,AutoCloseable
Stream interface for reading from a
ByteBuffer
(primarily for internal use)- See Also:
-
Constructor Summary
ConstructorDescriptionByteBufferInputStream
(ByteBuffer buffer) Creates an newInpuStream
, which reads from aByteBuffer
starting at the current buffer position. -
Method Summary
Methods inherited from class java.io.InputStream
available, close, mark, markSupported, nullInputStream, read, readAllBytes, readNBytes, readNBytes, reset, skip, skipNBytes, transferTo
-
Constructor Details
-
ByteBufferInputStream
Creates an newInpuStream
, which reads from aByteBuffer
starting at the current buffer position. Itsread()
methods can be intermixed with theget()
methods of the buffer, and also withByteBuffer.position(int)
, maintaining overall sequentiality of the calls. In other words, the stream's input is not decopuled from direct access to the buffer.- Parameters:
buffer
- the buffer to read from
-
-
Method Details
-
read
- Specified by:
read
in classInputStream
- Throws:
IOException
-
read
- Overrides:
read
in classInputStream
- Throws:
IOException
-