Class ByteBufferInputStreamIteator
java.lang.Object
com.github.basking2.sdsai.itrex.iterators.ByteBufferInputStreamIteator
- All Implemented Interfaces:
Iterator<ByteBuffer>
And Iterator that batches and streams reads from an InputStream.
When the last read() is called on the input stream returns a length less than 0,
the input stream is closed.
If you do not exhaust this iterator, you must close the input stream.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
hasNext()
next()
static final int
readOrClose
(InputStream in, byte[] nextBuffer) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Iterator
forEachRemaining, remove
-
Constructor Details
-
ByteBufferInputStreamIteator
- Throws:
IOException
-
-
Method Details
-
hasNext
public boolean hasNext()- Specified by:
hasNext
in interfaceIterator<ByteBuffer>
-
next
- Specified by:
next
in interfaceIterator<ByteBuffer>
-
readOrClose
- Throws:
IOException
-