public class FastByteArrayOutputStream
extends java.io.ByteArrayOutputStream
Modifier and Type | Field and Description |
---|---|
private int |
blockSize |
private byte[] |
buffer
Internal buffer.
|
private java.util.LinkedList |
buffers |
private static int |
DEFAULT_BLOCK_SIZE |
private int |
index |
private int |
size |
Constructor and Description |
---|
FastByteArrayOutputStream() |
FastByteArrayOutputStream(int aSize) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
flush() |
void |
reset() |
int |
size() |
byte[] |
toByteArray() |
java.lang.String |
toString() |
java.lang.String |
toString(java.lang.String enc) |
void |
write(byte[] data,
int offset,
int length) |
void |
write(int datum) |
void |
writeTo(java.io.OutputStream out) |
private static final int DEFAULT_BLOCK_SIZE
private byte[] buffer
private java.util.LinkedList buffers
private int index
private int size
private int blockSize
public FastByteArrayOutputStream()
public FastByteArrayOutputStream(int aSize)
public void writeTo(java.io.OutputStream out) throws java.io.IOException
writeTo
in class java.io.ByteArrayOutputStream
java.io.IOException
public int size()
size
in class java.io.ByteArrayOutputStream
public byte[] toByteArray()
toByteArray
in class java.io.ByteArrayOutputStream
public void write(int datum)
write
in class java.io.ByteArrayOutputStream
public void write(byte[] data, int offset, int length)
write
in class java.io.ByteArrayOutputStream
public void reset()
reset
in class java.io.ByteArrayOutputStream
public java.lang.String toString(java.lang.String enc) throws java.io.UnsupportedEncodingException
toString
in class java.io.ByteArrayOutputStream
java.io.UnsupportedEncodingException
public java.lang.String toString()
toString
in class java.io.ByteArrayOutputStream
public void flush() throws java.io.IOException
flush
in interface java.io.Flushable
flush
in class java.io.OutputStream
java.io.IOException
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.ByteArrayOutputStream
java.io.IOException