sdsu.io
Class StringOutputStream

java.lang.Object
  |
  +--java.io.OutputStream
        |
        +--sdsu.io.StringOutputStream

public class StringOutputStream
extends java.io.OutputStream

An output stream that collects it output in a stringbuffer, which can be used to create a string.

Version:
1.0 28 November 1997
Author:
Roger Whitney (whitney@cs.sdsu.edu)
See Also:
StringWriter

Constructor Summary
StringOutputStream()
          Create a new StringOutputStream with the default initial buffer size.
StringOutputStream(int initialBufferSize)
          Create a new StringOutputStream with the specified initial buffer size.
 
Method Summary
 void close()
          Close the stream
 void flush()
          Flush the stream
 java.lang.StringBuffer getBuffer()
          Return the stringbuffer
 java.lang.String toString()
          Return the output as a String.
 void write(int outputChar)
          Write a single character.
 
Methods inherited from class java.io.OutputStream
write, write
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StringOutputStream

public StringOutputStream()
Create a new StringOutputStream with the default initial buffer size.

StringOutputStream

public StringOutputStream(int initialBufferSize)
Create a new StringOutputStream with the specified initial buffer size.
Method Detail

close

public void close()
Close the stream
Overrides:
close in class java.io.OutputStream

flush

public void flush()
Flush the stream
Overrides:
flush in class java.io.OutputStream

getBuffer

public java.lang.StringBuffer getBuffer()
Return the stringbuffer

toString

public java.lang.String toString()
Return the output as a String.
Overrides:
toString in class java.lang.Object

write

public void write(int outputChar)
Write a single character. Ignores end of file.
Overrides:
write in class java.io.OutputStream