danbikel.switchboard
Class TextObjectWriter
java.lang.Object
java.io.Writer
java.io.PrintWriter
danbikel.switchboard.TextObjectWriter
- All Implemented Interfaces:
- ObjectWriter, Closeable, Flushable, Appendable
public class TextObjectWriter
- extends PrintWriter
- implements ObjectWriter
A simple ObjectWriter
that merely prints out objects' string
representations (as determined by their toString
methods)
to an underlying character stream (Writer
) followed by a
newline.
- See Also:
TextObjectWriterFactory
Method Summary |
void |
writeObject(Object obj)
Writes the string representation of the specified object (as
determined by its toString method) followed by a
newline to the underlying Writer and flushes the
stream. |
Methods inherited from class java.io.PrintWriter |
append, append, append, checkError, clearError, 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, write, write, write, write, write |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TextObjectWriter
public TextObjectWriter(OutputStream os)
throws IOException
- Throws:
IOException
TextObjectWriter
public TextObjectWriter(OutputStream os,
String encoding,
int bufSize)
throws IOException
- Throws:
IOException
TextObjectWriter
public TextObjectWriter(String filename,
String encoding,
int bufSize,
boolean append)
throws IOException
- Throws:
IOException
writeObject
public void writeObject(Object obj)
throws IOException
- Writes the string representation of the specified object (as
determined by its
toString
method) followed by a
newline to the underlying Writer
and flushes the
stream.
- Specified by:
writeObject
in interface ObjectWriter
- Throws:
IOException
- if the underlying Writer
or
output stream throws an IOException
Author: Dan Bikel.