| Modifier and Type | Field and Description |
|---|---|
| private int | arrayIndex
Index of the array we are currently reading from. |
| private final ArrayList | arrays
A list of the arrays to combine. |
| private byte[] | curArray
The array we are currently reading from. |
| private long | gOffset
Global offset into the whole stream. |
| private int | off
The local offset into the current array. |
| private final long | specifiedLength
Length of the stream. |
| Access | Constructor and Description |
|---|---|
| public | ByteArrayCombinerStream(ArrayList<byte[]>
an arraysIn, long ArrayList with references to the source
byte arrays. The references are copied to a new
ArrayList instance.the length of the stream. Never published outside
this object. Note that the length specified can be shorter
than the actual number of bytes in the byte arrays. length)Create a stream whose source is a list of byte arrays. |
| Modifier and Type | Method and Description |
|---|---|
| public int | Returns: number of available bytesOverrides java. |
| private byte[] | Returns: abyte[]-object, or null if there are
no more arraysFetch the next array to read data from. |
| public int | Returns: a byte, or-1 if the end-of-stream is reachedImplements abstract java. |
| public int | Returns: the number of bytes read, or-1 if end-of-stream
is reachedthe array to copy bytes into buf, int offset into the array offset, int the maximum number of bytes to read length)Overrides java. |
| arrayIndex | back to summary |
|---|---|
| private int arrayIndex Index of the array we are currently reading from. | |
| arrays | back to summary |
|---|---|
| private final ArrayList<byte[]> arrays A list of the arrays to combine. | |
| curArray | back to summary |
|---|---|
| private byte[] curArray The array we are currently reading from. | |
| gOffset | back to summary |
|---|---|
| private long gOffset Global offset into the whole stream. | |
| off | back to summary |
|---|---|
| private int off The local offset into the current array. | |
| specifiedLength | back to summary |
|---|---|
| private final long specifiedLength Length of the stream. | |
| ByteArrayCombinerStream | back to summary |
|---|---|
| public ByteArrayCombinerStream(ArrayList<byte[]> arraysIn, long length) Create a stream whose source is a list of byte arrays.
| |
| available | back to summary |
|---|---|
| public int available() Overrides java. Return the number of available bytes. The method assumes the specified length of the stream is correct.
| |
| nextArray | back to summary |
|---|---|
| private byte[] nextArray() Fetch the next array to read data from.
The reference in the
| |
| read | back to summary |
|---|---|
| public int read() throws IOException Implements abstract java. Read a single byte.
| |
| read | back to summary |
|---|---|
| public int read(byte[] buf, int offset, int length) throws IOException Overrides java. Reads up to len bytes of data from the input stream into an array of
bytes.
An attempt is made to read as many as
| |