public class FastByteArrayOutputStream
extends java.io.OutputStream
Modifier and Type | Field and Description |
---|---|
protected byte[] |
buf
Buffer and size
|
protected int |
size |
Constructor and Description |
---|
FastByteArrayOutputStream()
Constructs a stream with buffer capacity size 5K
|
FastByteArrayOutputStream(int initSize)
Constructs a stream with the given initial size
|
Modifier and Type | Method and Description |
---|---|
byte[] |
getByteArray()
Returns the byte array containing the written data.
|
java.io.InputStream |
getInputStream()
Returns a ByteArrayInputStream for reading back the written data
|
int |
getSize() |
void |
reset() |
void |
write(byte[] b) |
void |
write(byte[] b,
int off,
int len) |
void |
write(int b) |
public FastByteArrayOutputStream()
public FastByteArrayOutputStream(int initSize)
initSize
- public int getSize()
public byte[] getByteArray()
public final void write(byte[] b)
write
in class java.io.OutputStream
b
- public final void write(byte[] b, int off, int len)
write
in class java.io.OutputStream
b
- off
- len
- public final void write(int b)
write
in class java.io.OutputStream
b
- public void reset()
public java.io.InputStream getInputStream()