webwork.util
Class FastByteArrayOutputStream

java.lang.Object
  extended byjava.io.OutputStream
      extended bywebwork.util.FastByteArrayOutputStream

public class FastByteArrayOutputStream
extends java.io.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.3 $
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()
           
 java.lang.String toString()
           
 void write(byte[] data, int offset, int length)
           
 void write(int datum)
           
 void writeTo(javax.servlet.jsp.JspWriter out, java.lang.String encoding)
           
 void writeTo(java.io.OutputStream out)
           
 void writeTo(java.io.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

writeTo

public void writeTo(java.io.OutputStream out)
             throws java.io.IOException
Throws:
java.io.IOException

writeTo

public void writeTo(java.io.RandomAccessFile out)
             throws java.io.IOException
Throws:
java.io.IOException

writeTo

public void writeTo(javax.servlet.jsp.JspWriter out,
                    java.lang.String encoding)
             throws java.io.IOException
Throws:
java.io.IOException

getSize

public int getSize()

toByteArray

public byte[] toByteArray()

toString

public java.lang.String toString()

addBuffer

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


write

public void write(int datum)
           throws java.io.IOException
Throws:
java.io.IOException

write

public void write(byte[] data,
                  int offset,
                  int length)
           throws java.io.IOException
Throws:
java.io.IOException

close

public void close()


Copyright © 2001-2003 WebWork All Rights Reserved.