com.opensymphony.module.sitemesh.util
Class FastByteArrayOutputStream
java.lang.Object
java.io.OutputStream
java.io.ByteArrayOutputStream
com.opensymphony.module.sitemesh.util.FastByteArrayOutputStream
- public class FastByteArrayOutputStream
- extends ByteArrayOutputStream
A speedy implementation of ByteArrayOutputStream. It's not synchronized, and it
does not copy buffers when it's expanded. There's also no copying of the internal buffer
if it's contents is extracted with the writeTo(stream) method.
- Version:
- $Revision: 1.2 $
- Author:
- Rickard �berg, Scott Farquhar
DEFAULT_BLOCK_SIZE
private static final int DEFAULT_BLOCK_SIZE
- See Also:
- Constant Field Values
buffer
private byte[] buffer
- Internal buffer.
buffers
private LinkedList buffers
index
private int index
size
private int size
blockSize
private int blockSize
FastByteArrayOutputStream
public FastByteArrayOutputStream()
FastByteArrayOutputStream
public FastByteArrayOutputStream(int aSize)
writeTo
public void writeTo(OutputStream out)
throws IOException
- Throws:
IOException
size
public int size()
toByteArray
public byte[] toByteArray()
write
public void write(int datum)
write
public void write(byte[] data,
int offset,
int length)
reset
public void reset()
toString
public String toString(String enc)
throws UnsupportedEncodingException
- Throws:
UnsupportedEncodingException
toString
public String toString()
flush
public void flush()
throws IOException
- Throws:
IOException
close
public void close()
throws IOException
- Throws:
IOException