sdsu.io
Class StringizableWriter

java.lang.Object
  |
  +--sdsu.io.StringizableWriter

public class StringizableWriter
extends java.lang.Object

Writes objects that implement the Stringizable inteface to a stream(or writer). The object is converted to a string which can be used to recreate the object. A StringizableReader can be used to recreate the objects saved by StringizableWriter.

Note while StringizableWriter uses the name Writer it is NOT a subclass of Writer. The class acts like a Writer but it does not make sense to allow arbitrary writes to a the stream, as it will corrupt the object format.

Version:
0.8 7 January 1998
Author:
Roger Whitney (whitney@cs.sdsu.edu)
See Also:
Stringizable, StringizableReader

Constructor Summary
StringizableWriter(java.io.Writer out)
           
StringizableWriter(java.io.Writer out, java.lang.String objectSeparator)
           
 
Method Summary
 void close()
          Close the stream StringizableWriter is writing on.
 void flush()
          Flush the stream StringizableWriter is writing on.
 void writeObject(Stringizable object)
          Write the object on the output stream.
 void writeObject(Stringizable object, java.lang.String label)
          Write the object on the output stream and attach the label to the object.
 void writeObject(Stringizable object, java.lang.String label, java.lang.String comment)
          Write the object and attached label and comment on the output stream.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringizableWriter

public StringizableWriter(java.io.Writer out)

StringizableWriter

public StringizableWriter(java.io.Writer out,
                          java.lang.String objectSeparator)
                   throws java.io.IOException
Method Detail

close

public void close()
           throws java.io.IOException
Close the stream StringizableWriter is writing on.

flush

public void flush()
           throws java.io.IOException
Flush the stream StringizableWriter is writing on.

writeObject

public void writeObject(Stringizable object)
                 throws java.io.IOException
Write the object on the output stream. Object can be read by StringizableReader.

writeObject

public void writeObject(Stringizable object,
                        java.lang.String label)
                 throws java.io.IOException
Write the object on the output stream and attach the label to the object. Object and label can be read by StringizableReader.

writeObject

public void writeObject(Stringizable object,
                        java.lang.String label,
                        java.lang.String comment)
                 throws java.io.IOException
Write the object and attached label and comment on the output stream. Object, label, and comment can be read by StringizableReader.