Class sfclasses.PersistentOutputStream
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class sfclasses.PersistentOutputStream

java.lang.Object
   |
   +----java.io.OutputStream
           |
           +----java.io.FilterOutputStream
                   |
                   +----java.io.PrintStream
                           |
                           +----sfclasses.PersistentOutputStream

public class PersistentOutputStream
extends PrintStream
This stream is used to save data to a persistent state. Normally the methods are called from the write() method defined in the Persistent interface.
When you want to start the save process, you have to create a new PersistentOutputStream passing the data output stream as parameter. Then call the appropriate method to save the object you are using as starting point (e.g. writePersistent). Any objects contained in this object are automatically saved (recursively).

Constructor Index

 o PersistentOutputStream(OutputStream)
Initialize the stream using fs as data destination.

Method Index

 o writeBoolean(String, boolean)
Write boolean.
 o writeDouble(String, double)
Write double.
 o writeInt(String, int)
Write integer.
 o writeObject(String, Object)
Write object that does not implement Persistent.
 o writePersistent(String, Persistent)
Write object of a class that implements Persistent.
 o writePersistentVector(String, Vector)
Write vector.
 o writeString(String, String)
Write string.

Constructors

 o PersistentOutputStream
  public PersistentOutputStream(OutputStream fs)
Initialize the stream using fs as data destination.
Parameters:
fs - Data output stream

Methods

 o writeObject
  public void writeObject(String s,
                          Object x)
Write object that does not implement Persistent. An object written with writeObject cannot be restored properly; only the string returned by the object's toString() method is written to the stream.
Parameters:
s - Identification string, must end with a comma!
x - Object to write
 o writeInt
  public void writeInt(String s,
                       int x)
Write integer.
Parameters:
s - Identification string, must end with a comma!
x - Integer to write
 o writeDouble
  public void writeDouble(String s,
                          double x)
Write double.
Parameters:
s - Identification string, must end with a comma!
x - Value to write
 o writeBoolean
  public void writeBoolean(String s,
                           boolean x)
Write boolean.
Parameters:
s - Identification string, must end with a comma!
x - Value to write
 o writeString
  public void writeString(String s,
                          String x)
Write string.
Parameters:
s - Identification string, must end with a comma!
x - Value to write
 o writePersistent
  public void writePersistent(String s,
                              Persistent x)
Write object of a class that implements Persistent.
Parameters:
s - Identification string, must end with a comma!
x - Object to write
 o writePersistentVector
  public void writePersistentVector(String s,
                                    Vector e)
Write vector.
Parameters:
s - Identification string, must end with a comma!
e - Vector to write

All Packages  Class Hierarchy  This Package  Previous  Next  Index