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).
-
PersistentInputStream(InputStream)
-
Initialize the stream using fs as data source.
-
readBoolean(String)
- Read boolean.
-
readDouble(String)
- Read double.
-
readInt(String)
- Read integer.
-
readPersistent(String)
- Read object
-
readPersistentVector(String)
- Read vector.
-
readString(String)
- Read string.
-
skipString(String)
- Skip given string.
PersistentInputStream
public PersistentInputStream(InputStream fs)
- Initialize the stream using fs as data source.
- Parameters:
- fs - data input stream
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.
readInt
public int readInt(String skip) throws IOException
- Read integer.
- Parameters:
- skip - Identification string, must end with a comma!
- Returns:
- Value read
readBoolean
public boolean readBoolean(String skip) throws IOException
- Read boolean.
- Parameters:
- skip - Identification string, must end with a comma!
- Returns:
- Value read
readDouble
public double readDouble(String skip) throws IOException
- Read double.
- Parameters:
- skip - Identification string, must end with a comma!
- Returns:
- Value read
readString
public String readString(String skip) throws IOException
- Read string.
- Parameters:
- skip - Identification string, must end with a comma!
- Returns:
- Value read
readPersistentVector
public Vector readPersistentVector(String skip) throws IOException
- Read vector.
- Parameters:
- skip - Identification string, must end with a comma!
- Returns:
- Vector read
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