Class semper.util.serial.TargetStream
All Packages Class Hierarchy This Package Previous Next Index
Class semper.util.serial.TargetStream
java.lang.Object
|
+----java.io.OutputStream
|
+----java.io.FilterOutputStream
|
+----java.io.DataOutputStream
|
+----semper.util.serial.TargetStream
- public class TargetStream
- extends DataOutputStream
- implements StreamInterface, StreamOutputInterface
A data output stream that lets you write primitive Java data types
to the stream to externalize the state of an object.
To externalize object o
, create a
TargetStream object stream
and use its method
writeObject()
to write the object's internal state to
output stream out
:
TargetStream stream = new TargetStream(out);
stream.writeObject(o);
- Version:
- 2.0, 05/28/96
- Author:
- Günter Karjoth
- See Also:
- Streamable, StreamOutputInterface, SourceStream
-
TargetStream(OutputStream)
- Creates a new TargetStream.
-
sizeOfBoolean()
- Returns the size of a TargetStream holding the value of a Boolean.
-
sizeOfChar()
- Returns the size of a TargetStream holding the value of a Char.
-
sizeOfDouble()
- Returns the size of a TargetStream holding the value of a Double.
-
sizeOfFloat()
- Returns the size of a TargetStream holding the value of a Float.
-
sizeOfInt()
- Returns the size of a TargetStream holding the value of an Integer.
-
sizeOfLong()
- Returns the size of a TargetStream holding the value of a Long.
-
sizeOfObject(Object)
- Returns the size of a TargetStream holding the internal state of the
Object.
-
writeObject(Object)
- Externalizes an object by writing its state to the TargetStream.
TargetStream
public TargetStream(OutputStream out) throws IOException, StreamIOException
- Creates a new TargetStream.
writeObject
public final synchronized void writeObject(Object o) throws IOException, StreamIOException
- Externalizes an object by writing its state to the TargetStream.
- Throws: IOException
- Otherwise.
sizeOfBoolean
public static int sizeOfBoolean()
- Returns the size of a TargetStream holding the value of a Boolean.
sizeOfChar
public static int sizeOfChar()
- Returns the size of a TargetStream holding the value of a Char.
sizeOfDouble
public static int sizeOfDouble()
- Returns the size of a TargetStream holding the value of a Double.
sizeOfFloat
public static int sizeOfFloat()
- Returns the size of a TargetStream holding the value of a Float.
sizeOfInt
public static int sizeOfInt()
- Returns the size of a TargetStream holding the value of an Integer.
sizeOfLong
public static int sizeOfLong()
- Returns the size of a TargetStream holding the value of a Long.
sizeOfObject
public static int sizeOfObject(Object o) throws StreamIOException
- Returns the size of a TargetStream holding the internal state of the
Object.
All Packages Class Hierarchy This Package Previous Next Index