class IterableByteBufferInputStream
extends java.io.InputStream
Modifier and Type | Field and Description |
---|---|
private long |
currentAddress
If the current ByteBuffer is unsafe-direct based, currentAddress is the start address of this
ByteBuffer; otherwise should be zero.
|
private byte[] |
currentArray
If the current ByteBuffer is unsafe-direct based, currentArray is null; otherwise should be the
array inside ByteBuffer.
|
private int |
currentArrayOffset
Current ByteBuffer's array offset
|
private java.nio.ByteBuffer |
currentByteBuffer
The current ByteBuffer;
|
private int |
currentByteBufferPos
The current position for current ByteBuffer
|
private int |
currentIndex
Current
ByteBuffer 's index |
private int |
dataSize
The number of ByteBuffers in the input data.
|
private boolean |
hasArray
Whether current ByteBuffer has an array
|
private java.util.Iterator<java.nio.ByteBuffer> |
iterator
The
Iterator with type ByteBuffer of input |
Constructor and Description |
---|
IterableByteBufferInputStream(java.lang.Iterable<java.nio.ByteBuffer> data) |
Modifier and Type | Method and Description |
---|---|
private boolean |
getNextByteBuffer() |
int |
read() |
int |
read(byte[] output,
int offset,
int length) |
private void |
updateCurrentByteBufferPos(int numberOfBytesRead) |
private java.util.Iterator<java.nio.ByteBuffer> iterator
Iterator
with type ByteBuffer
of input
private java.nio.ByteBuffer currentByteBuffer
private int dataSize
private int currentIndex
ByteBuffer
's index
If index equals dataSize, then all the data in the InputStream has been consumed
private int currentByteBufferPos
private boolean hasArray
private byte[] currentArray
private int currentArrayOffset
private long currentAddress
IterableByteBufferInputStream(java.lang.Iterable<java.nio.ByteBuffer> data)
private boolean getNextByteBuffer()
private void updateCurrentByteBufferPos(int numberOfBytesRead)
public int read() throws java.io.IOException
read
in class java.io.InputStream
java.io.IOException
public int read(byte[] output, int offset, int length) throws java.io.IOException
read
in class java.io.InputStream
java.io.IOException