MultiByteArrayInputStream

aab - a non-null array of byte arrays of data to stream, each byte array must be non-null and non-zero-length

MultiByteArrayInputStream

public MultiByteArrayInputStream(byte[][] aab,
boolean fDestructive)

Construct a MultiByteArrayInputStream.

Parameters:

aab - a non-null array of byte arrays of data to stream, each byte array must be non-null and non-zero-length

fDestructive - if true the supplied array will be cleared as it is traversed, stream mark positions will be respected

Method Detail

read

public int read()
throws java.io.IOException

Reads the next byte of data from the input stream. The value byte is returned as an int in the range 0 to 255. If no byte is available because the end of the stream has been reached, the value -1 is returned. This method blocks until input data is available, the end of the stream is detected, or an exception is thrown.

read

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 len bytes, but a smaller number may be read, possibly zero. The number of bytes actually read is returned as an integer.

the total number of bytes read into the buffer, or -1 if there is no more data because the end of the stream has been reached.

Throws:

java.io.IOException - if an I/O error occurs

available

public int available()

Returns the number of bytes that can be read (or skipped over) from this input stream without blocking by the next caller of a method for this input stream. The next caller might be the same thread or or another thread.

the number of bytes that can be read from this input stream without blocking.

skip

public long skip(long n)

Skips over and discards n bytes of data from this input stream. The skip method may, for a variety of reasons, end up skipping over some smaller number of bytes, possibly 0. This may result from any of a number of conditions; reaching end of file before n bytes have been skipped is only one possibility. The actual number of bytes skipped is returned. If n is negative, no bytes are skipped.