fr.gedeon.telnetservice.util
Class StringBufferPrintStream
java.lang.Object
java.io.OutputStream
java.io.FilterOutputStream
java.io.PrintStream
fr.gedeon.telnetservice.util.AbstractPrintStream
fr.gedeon.telnetservice.util.StringBufferPrintStream
- All Implemented Interfaces:
- Closeable, Flushable, Appendable
public class StringBufferPrintStream
- extends AbstractPrintStream
This provides a PrintStream
implementation that outputs the stream to an
internal StringBuffer
that is available through getBuffer()
.
Note: Instances of this class do not to be close
d, and can be reused by
clearing the buffer between uses: getBuffer()
.setLength(0)
.
Methods inherited from class java.io.PrintStream |
append, append, append, checkError, close, flush, format, format, print, print, print, print, print, print, print, print, print, printf, printf, println, println, println, println, println, println, println, println, println, println, setError |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
StringBufferPrintStream
public StringBufferPrintStream()
write
public void write(int b)
- Specified by:
write
in class AbstractPrintStream
write
public void write(byte[] buf,
int off,
int len)
- Specified by:
write
in class AbstractPrintStream
getBuffer
public StringBuffer getBuffer()
- Get the internal storage
StringBuffer
. Note: changes to the returned object will
change the internal buffer (it's not a copy).
Copyright © 2008. All Rights Reserved.