public final class CloseableIteratorBufferAsInputStream extends AbstractCloseableIteratorAsInputStream<Buffer>
Constructor and Description |
---|
CloseableIteratorBufferAsInputStream(CloseableIterator<Buffer> iterator)
Create a new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
protected boolean |
hasLeftOver()
Determine if there are left over bytes buffered.
|
protected boolean |
isClosed()
Determine if
AbstractCloseableIteratorAsInputStream.close() has been called. |
protected void |
leftOverCheckReset()
Check if the left over buffer needs to be reset.
|
protected int |
leftOverReadableBytes()
Get the number of readable bytes in the left over buffer.
|
protected void |
leftOverReadBytes(byte[] dst,
int offset,
int length)
Read bytes from the left over buffer into
b . |
protected byte |
leftOverReadSingleByte()
Read a single byte from the left over buffer.
|
protected void |
leftOverReset()
Reset the left over buffer.
|
protected void |
nextLeftOver(CloseableIterator<Buffer> iterator)
Read the next element from the
Iterator . |
available, markSupported, read, read
public CloseableIteratorBufferAsInputStream(CloseableIterator<Buffer> iterator)
iterator
- The CloseableIterator
providing data.protected int leftOverReadableBytes()
AbstractCloseableIteratorAsInputStream
leftOverReadableBytes
in class AbstractCloseableIteratorAsInputStream<Buffer>
protected void leftOverReadBytes(byte[] dst, int offset, int length)
AbstractCloseableIteratorAsInputStream
b
.leftOverReadBytes
in class AbstractCloseableIteratorAsInputStream<Buffer>
dst
- The destination to read to.offset
- The offset to read into for dst
.length
- The amount of bytes to read from the left over buffer.protected boolean hasLeftOver()
AbstractCloseableIteratorAsInputStream
hasLeftOver
in class AbstractCloseableIteratorAsInputStream<Buffer>
true
if there are left over bytes buffered.protected void leftOverCheckReset()
AbstractCloseableIteratorAsInputStream
leftOverCheckReset
in class AbstractCloseableIteratorAsInputStream<Buffer>
protected void leftOverReset()
AbstractCloseableIteratorAsInputStream
leftOverReset
in class AbstractCloseableIteratorAsInputStream<Buffer>
protected void nextLeftOver(CloseableIterator<Buffer> iterator)
AbstractCloseableIteratorAsInputStream
Iterator
.nextLeftOver
in class AbstractCloseableIteratorAsInputStream<Buffer>
iterator
- The CloseableIterator
to get the next element from.protected byte leftOverReadSingleByte()
AbstractCloseableIteratorAsInputStream
leftOverReadSingleByte
in class AbstractCloseableIteratorAsInputStream<Buffer>
protected boolean isClosed()
AbstractCloseableIteratorAsInputStream
AbstractCloseableIteratorAsInputStream.close()
has been called.isClosed
in class AbstractCloseableIteratorAsInputStream<Buffer>
true
if AbstractCloseableIteratorAsInputStream.close()
has been called.public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class AbstractCloseableIteratorAsInputStream<Buffer>
java.io.IOException