com.opensymphony.webwork.util
Class FastByteArrayOutputStream
java.lang.Object
java.io.OutputStream
com.opensymphony.webwork.util.FastByteArrayOutputStream
- All Implemented Interfaces:
- Closeable, Flushable
public class FastByteArrayOutputStream
- extends OutputStream
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:
- $Date: 2008-01-19 10:09:56 +0800 (Sat, 19 Jan 2008) $ $Id: FastByteArrayOutputStream.java 3000 2008-01-19 02:09:56Z tm_jee $
- Author:
- Rickard ???berg, Brat Baker (Atlassian), Alexey
FastByteArrayOutputStream
public FastByteArrayOutputStream()
FastByteArrayOutputStream
public FastByteArrayOutputStream(int aSize)
getSize
public int getSize()
close
public void close()
- Specified by:
close
in interface Closeable
- Overrides:
close
in class OutputStream
toByteArray
public byte[] toByteArray()
toString
public String toString()
- Overrides:
toString
in class Object
write
public void write(int datum)
throws IOException
- Specified by:
write
in class OutputStream
- Throws:
IOException
write
public void write(byte[] data,
int offset,
int length)
throws IOException
- Overrides:
write
in class OutputStream
- Throws:
IOException
writeTo
public void writeTo(OutputStream out)
throws IOException
- Throws:
IOException
writeTo
public void writeTo(RandomAccessFile out)
throws IOException
- Throws:
IOException
writeTo
public void writeTo(Writer out,
String encoding)
throws IOException
- Throws:
IOException
addBuffer
protected void addBuffer()
- Create a new buffer and store the
current one in linked list