public class ByteArrayStream
extends java.lang.Object
Constructor and Description |
---|
ByteArrayStream()
Creates a new stream intance with default initial capacity.
|
ByteArrayStream(byte[] data)
Creates a new stream intance.
|
ByteArrayStream(int initialCapacity)
Creates a new stream intance.
|
Modifier and Type | Method and Description |
---|---|
int |
available()
Returns the stream available bytes.
|
int |
read()
Reads a byte from the stream.
|
int |
read(byte[] b)
Reads the stream data into specified buffer.
|
int |
read(byte[] b,
int off,
int len)
Reads the stream data into specified buffer.
|
void |
write(byte[] b)
Writes an array of bytes to the stream.
|
void |
write(byte[] b,
int off,
int len)
Writes an array of bytes to the stream.
|
void |
write(int b)
Writes one byte to the stream.
|
public ByteArrayStream(byte[] data)
data
- the initial stream datapublic ByteArrayStream(int initialCapacity)
initialCapacity
- the initial buffer capacitypublic ByteArrayStream()
public int available()
public void write(int b)
b
- the byte to writepublic void write(byte[] b, int off, int len)
b
- the array to writeoff
- the array offsetlen
- the data lengthpublic void write(byte[] b)
b
- the array to writepublic int read()
public int read(byte[] b, int off, int len)
b
- the data bufferoff
- the buffer offsetlen
- the requested data lengthpublic int read(byte[] b)
b
- the data bufferCopyright © JSCAPE LLC. 1999-2014. All Rights Reserved