Class ByteArrayInStream

Hierarchy: Object , ByteArrayInStream
All Implemented Interfaces: InStream
public class ByteArrayInStream
implements InStream
Allows an array of bytes to be used as an InStream. To optimize memory usage, instances can be reused with different byte arrays.
public ByteArrayInStream(byte[] buffer)
Creates a new stream based on the given buffer.
Parameters:
buffer - buffer the bytes to read
public void setBytes(byte[] buffer)
Sets this stream to read from the given buffer
Parameters:
buffer - buffer the bytes to read
public void read(byte[] buf)
Reads up to buf.length bytes from the stream into the given byte buffer.
Parameters:
buf - buf the buffer to place the read bytes into