adavid.io
Class  StringOutputStream
java.lang.Object
  |
  +--java.io.OutputStream
        |
        +--adavid.io.StringOutputStream
- public class StringOutputStream- extends java.io.OutputStream
StringOuputStream
 output stream to a string
 
| Method Summary | 
|  int | length()forward StringBuffer functions
 | 
|  void | setLength(int l)
 | 
|  java.lang.String | toString()returns the written string
 | 
|  void | write(int b)implements the stream: writes the byte to the string buffer
 | 
 
| 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, 
wait, 
wait, 
wait | 
 
StringOutputStream
public StringOutputStream()
- default constructor: to a string
StringOutputStream
public StringOutputStream(int size)
- or fix the buffer size
StringOutputStream
public StringOutputStream(java.lang.StringBuffer buf)
- or takes the buffer directly
write
public void write(int b)
- implements the stream: writes the byte to the string buffer- 
- Overrides:
- write in class java.io.OutputStream
 
toString
public java.lang.String toString()
- returns the written string- 
- Overrides:
- toString in class java.lang.Object
 
length
public int length()
- forward StringBuffer functions
setLength
public void setLength(int l)