All Packages Class Hierarchy This Package Previous Next Index
Class au.com.pharos.packing.SerializationPacking
au.com.pharos.packing.Packing
|
+----au.com.pharos.packing.SerializationPacking
- public class SerializationPacking
- extends Packing
A packing strategy which stores and retrieves objects using
Java serialization.
- Version:
- $Revision: 1.4 $
- Author:
- Martin Pool
- See Also:
- Packing
-
SerializationPacking()
-
-
fromBytes(byte[])
- Interprets raw as a Java serialization stream, and
returns the first object read from that stream.
-
toBytes(Object)
- Convert an object to a Java serialization format.
SerializationPacking
public SerializationPacking()
toBytes
public byte[] toBytes(Object obj) throws IllegalArgumentException
- Convert an object to a Java serialization format.
- Returns:
- s a buffer containing a a serialized representation of obj;
or null if obj if null
- Throws: IllegalArgumentException
- if obj (or any object
referred to by obj) cannot be serialized
- Overrides:
- toBytes in class Packing
fromBytes
public Object fromBytes(byte raw[])
- Interprets raw as a Java serialization stream, and
returns the first object read from that stream.
Note:There is currently no means by which any later
objects in the can be retrieved: it is assumed that the object
written to the buffer contains references to all the
information required. This is consistent with the fact that
toBytes() stores only a single object, so this packing strategy
is completely reversable.
- Overrides:
- fromBytes in class Packing
All Packages Class Hierarchy This Package Previous Next Index