com.opensymphony.webwork.util
Class FastByteArrayOutputStream

java.lang.Object
  extended byjava.io.OutputStream
      extended bycom.opensymphony.webwork.util.FastByteArrayOutputStream

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:
$Revision: 1.9 $
Author:
Rickard ?berg

Constructor Summary
FastByteArrayOutputStream()
           
FastByteArrayOutputStream(int aSize)
           
 
Method Summary
protected  void addBuffer()
          Create a new buffer and store the current one in linked list
 void close()
           
 int getSize()
           
 byte[] toByteArray()
           
 String toString()
           
 void write(byte[] data, int offset, int length)
           
 void write(int datum)
           
 void writeTo(JspWriter out, String encoding)
           
 void writeTo(OutputStream out)
           
 void writeTo(RandomAccessFile out)
           
 
Methods inherited from class java.io.OutputStream
flush, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FastByteArrayOutputStream

public FastByteArrayOutputStream()

FastByteArrayOutputStream

public FastByteArrayOutputStream(int aSize)
Method Detail

getSize

public int getSize()

close

public void close()

toByteArray

public byte[] toByteArray()

toString

public String toString()

write

public void write(int datum)
           throws IOException
Throws:
IOException

write

public void write(byte[] data,
                  int offset,
                  int length)
           throws IOException
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(JspWriter out,
                    String encoding)
             throws IOException
Throws:
IOException

addBuffer

protected void addBuffer()
Create a new buffer and store the current one in linked list


WebWork Project Page