public class ByteArrayCombinerStream extends InputStream
| Constructor and Description |
|---|
ByteArrayCombinerStream(ArrayList arraysIn,
long length)
Create a stream whose source is a list of byte arrays.
|
| Modifier and Type | Method and Description |
|---|---|
int |
available()
Return the number of available bytes.
|
int |
read()
Read a single byte.
|
int |
read(byte[] buf,
int offset,
int length)
Reads up to len bytes of data from the input stream into an array of
bytes.
|
close, mark, markSupported, read, reset, skippublic ByteArrayCombinerStream(ArrayList arraysIn, long length)
arraysIn - an ArrayList with references to the source
byte arrays. The references are copied to a new
ArrayList instance.length - 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.IllegalArgumentException - if there is less data available than
specified by length, or length is
negative.public int read()
throws IOException
read in class InputStream-1 if the end-of-stream is reachedIOExceptionpublic int read(byte[] buf,
int offset,
int length)
throws IOException
len bytes, but
a smaller number may be read. The number of bytes actually read
is returned as an integer.read in class InputStreambuf - the array to copy bytes intooffset - offset into the arraylength - the maximum number of bytes to read-1 if end-of-stream
is reachedIOExceptionpublic int available()
available in class InputStreamCopyright © 2010-2015 Pivotal Software, Inc. All rights reserved.