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

Class sfclasses.PersistentInputStream

java.lang.Object
   |
   +----java.io.InputStream
           |
           +----java.io.FilterInputStream
                   |
                   +----java.io.PushbackInputStream
                           |
                           +----sfclasses.PersistentInputStream

public class PersistentInputStream
extends PushbackInputStream
This stream is used to restore data from a persistent state. Normally the methods are called from the read() method defined in the Persistent interface.
When you want to start the restore process, you have to create a new PersistentInputStream passing the data input stream as parameter. Then call the appropriate method to restore the object you are using as starting point (e.g. readPersistent). Any objects contained in this object are automatically restored (recursively).

Constructor Index

 o PersistentInputStream(InputStream)
Initialize the stream using fs as data source.

Method Index

 o readBoolean(String)
Read boolean.
 o readDouble(String)
Read double.
 o readInt(String)
Read integer.
 o readPersistent(String)
Read object
 o readPersistentVector(String)
Read vector.
 o readString(String)
Read string.
 o skipString(String)
Skip given string.

Constructors

 o PersistentInputStream
  public PersistentInputStream(InputStream fs)
Initialize the stream using fs as data source.
Parameters:
fs - data input stream

Methods

 o readPersistent
  public Persistent readPersistent(String skip) throws IOException
Read object
Parameters:
skip - Identification string, must end with a comma!
Returns:
Object read, must be typecast to assign to object variable.
 o readInt
  public int readInt(String skip) throws IOException
Read integer.
Parameters:
skip - Identification string, must end with a comma!
Returns:
Value read
 o readBoolean
  public boolean readBoolean(String skip) throws IOException
Read boolean.
Parameters:
skip - Identification string, must end with a comma!
Returns:
Value read
 o readDouble
  public double readDouble(String skip) throws IOException
Read double.
Parameters:
skip - Identification string, must end with a comma!
Returns:
Value read
 o readString
  public String readString(String skip) throws IOException
Read string.
Parameters:
skip - Identification string, must end with a comma!
Returns:
Value read
 o readPersistentVector
  public Vector readPersistentVector(String skip) throws IOException
Read vector.
Parameters:
skip - Identification string, must end with a comma!
Returns:
Vector read
 o skipString
  public void skipString(String s) throws IOException
Skip given string. Called from the various read() methods.

All Packages  Class Hierarchy  This Package  Previous  Next  Index