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