org.apache.geronimo.mail.util
Class StringBufferOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by org.apache.geronimo.mail.util.StringBufferOutputStream
All Implemented Interfaces:
Closeable, Flushable

public class StringBufferOutputStream
extends OutputStream

An implementation of an OutputStream that writes the data directly out to a StringBuffer object. Useful for applications where an intermediate ByteArrayOutputStream is required to append generated characters to a StringBuffer;


Field Summary
protected  StringBuffer buffer
           
 
Constructor Summary
StringBufferOutputStream(StringBuffer out)
          Create an output stream that writes to the target StringBuffer
 
Method Summary
 void write(int ch)
           
 
Methods inherited from class java.io.OutputStream
close, flush, write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

buffer

protected StringBuffer buffer
Constructor Detail

StringBufferOutputStream

public StringBufferOutputStream(StringBuffer out)
Create an output stream that writes to the target StringBuffer

Parameters:
out - The wrapped output stream.
Method Detail

write

public void write(int ch)
           throws IOException
Specified by:
write in class OutputStream
Throws:
IOException


Copyright © 2003-2008 The Apache Software Foundation. All Rights Reserved.