All Packages Class Hierarchy This Package Previous Next Index
Class Acme.SerialUtils
java.lang.Object
|
+----Acme.SerialUtils
- public class SerialUtils
- extends Object
Utilities for serializable objects.
These static routines help you serialize and deserialize the primitive
data types. Your own serialization routines will just be sequences of
calls to these.
This implementation of serialization is much simpler and less convenient
to use than the official one that will be in JDK1.1; but it has the
significant albeit temporary advantage that it works in current browsers.
One thing this version does not do is handle cyclic graphs of objects.
It only handles tree-shaped graphs. If you need to serialize more
complicated structures, consider using an ID-based scheme - instead of
having your objects contain actual references to other objects, have
them contain IDs which can be translated into real references by an
ID-manager class. This scheme also has the advantage that you don't
have to deserialize the entire graph all at once, you can do it piece
by piece as needed, and you can even set up a least-recently-used
flush policy in the ID-manager.
Fetch the software.
Fetch the entire Acme package.
- See Also:
- Serializable
-
SerialUtils()
-
-
deserializeArrayByte(DataInputStream)
- Utility routine to deserialize an array of bytes.
-
deserializeArrayChar(DataInputStream)
- Utility routine to deserialize an array of chars.
-
deserializeArrayDouble(DataInputStream)
- Utility routine to deserialize an array of doubles.
-
deserializeArrayFloat(DataInputStream)
- Utility routine to deserialize an array of floats.
-
deserializeArrayInt(DataInputStream)
- Utility routine to deserialize an array of ints.
-
deserializeArrayLong(DataInputStream)
- Utility routine to deserialize an array of longs.
-
deserializeArrayObject(DataInputStream)
- Utility routine to deserialize an array of objects.
-
deserializeArrayShort(DataInputStream)
- Utility routine to deserialize an array of shorts.
-
deserializeBoolean(DataInputStream)
- Utility routine to deserialize a boolean.
-
deserializeByte(DataInputStream)
- Utility routine to deserialize a byte.
-
deserializeChar(DataInputStream)
- Utility routine to deserialize a char.
-
deserializeDouble(DataInputStream)
- Utility routine to deserialize a double.
-
deserializeFloat(DataInputStream)
- Utility routine to deserialize a float.
-
deserializeHeader(Class, DataInputStream)
- Utility routine to read a serialization header.
-
deserializeInt(DataInputStream)
- Utility routine to deserialize a int.
-
deserializeLong(DataInputStream)
- Utility routine to deserialize a long.
-
deserializeObject(Class, DataInputStream)
- Utility routine to deserialize a sub-object.
-
deserializeShort(DataInputStream)
- Utility routine to deserialize a short.
-
deserializeString(DataInputStream)
- Utility routine to deserialize a String.
-
deserializeTrailer(Class, DataInputStream)
- Utility routine to read a serialization trailer.
-
main(String[])
- Test routine.
-
serializeArrayByte(byte[], DataOutputStream)
- Utility routine to serialize an array of bytes.
-
serializeArrayChar(char[], DataOutputStream)
- Utility routine to serialize an array of chars.
-
serializeArrayDouble(double[], DataOutputStream)
- Utility routine to serialize an array of doubles.
-
serializeArrayFloat(float[], DataOutputStream)
- Utility routine to serialize an array of floats.
-
serializeArrayInt(int[], DataOutputStream)
- Utility routine to serialize an array of ints.
-
serializeArrayLong(long[], DataOutputStream)
- Utility routine to serialize an array of longs.
-
serializeArrayObject(Serializable[], DataOutputStream)
- Utility routine to serialize an array of Objects.
-
serializeArrayShort(short[], DataOutputStream)
- Utility routine to serialize an array of shorts.
-
serializeBoolean(boolean, DataOutputStream)
- Utility routine to serialize a boolean.
-
serializeByte(byte, DataOutputStream)
- Utility routine to serialize a byte.
-
serializeChar(char, DataOutputStream)
- Utility routine to serialize a char.
-
serializeDouble(double, DataOutputStream)
- Utility routine to serialize a double.
-
serializeFloat(float, DataOutputStream)
- Utility routine to serialize a float.
-
serializeInt(int, DataOutputStream)
- Utility routine to serialize a int.
-
serializeLong(long, DataOutputStream)
- Utility routine to serialize a long.
-
serializeObject(Serializable, DataOutputStream)
- Utility routine to serialize a sub-object.
-
serializeShort(short, DataOutputStream)
- Utility routine to serialize a short.
-
serializeString(String, DataOutputStream)
- Utility routine to serialize a String.
SerialUtils
public SerialUtils()
serializeObject
public static void serializeObject(Serializable ser,
DataOutputStream dout) throws IOException
- Utility routine to serialize a sub-object.
serializeString
public static void serializeString(String str,
DataOutputStream dout) throws IOException
- Utility routine to serialize a String.
serializeBoolean
public static void serializeBoolean(boolean b,
DataOutputStream dout) throws IOException
- Utility routine to serialize a boolean.
serializeByte
public static void serializeByte(byte b,
DataOutputStream dout) throws IOException
- Utility routine to serialize a byte.
serializeChar
public static void serializeChar(char c,
DataOutputStream dout) throws IOException
- Utility routine to serialize a char.
serializeShort
public static void serializeShort(short s,
DataOutputStream dout) throws IOException
- Utility routine to serialize a short.
serializeInt
public static void serializeInt(int i,
DataOutputStream dout) throws IOException
- Utility routine to serialize a int.
serializeLong
public static void serializeLong(long l,
DataOutputStream dout) throws IOException
- Utility routine to serialize a long.
serializeFloat
public static void serializeFloat(float f,
DataOutputStream dout) throws IOException
- Utility routine to serialize a float.
serializeDouble
public static void serializeDouble(double d,
DataOutputStream dout) throws IOException
- Utility routine to serialize a double.
serializeArrayObject
public static void serializeArrayObject(Serializable ao[],
DataOutputStream dout) throws IOException
- Utility routine to serialize an array of Objects.
serializeArrayByte
public static void serializeArrayByte(byte ab[],
DataOutputStream dout) throws IOException
- Utility routine to serialize an array of bytes.
serializeArrayChar
public static void serializeArrayChar(char ac[],
DataOutputStream dout) throws IOException
- Utility routine to serialize an array of chars.
serializeArrayShort
public static void serializeArrayShort(short as[],
DataOutputStream dout) throws IOException
- Utility routine to serialize an array of shorts.
serializeArrayInt
public static void serializeArrayInt(int ai[],
DataOutputStream dout) throws IOException
- Utility routine to serialize an array of ints.
serializeArrayLong
public static void serializeArrayLong(long al[],
DataOutputStream dout) throws IOException
- Utility routine to serialize an array of longs.
serializeArrayFloat
public static void serializeArrayFloat(float af[],
DataOutputStream dout) throws IOException
- Utility routine to serialize an array of floats.
serializeArrayDouble
public static void serializeArrayDouble(double ad[],
DataOutputStream dout) throws IOException
- Utility routine to serialize an array of doubles.
deserializeHeader
public static boolean deserializeHeader(Class cl,
DataInputStream din) throws IOException
- Utility routine to read a serialization header.
Special case: returns false if the object is null.
deserializeTrailer
public static void deserializeTrailer(Class cl,
DataInputStream din) throws IOException
- Utility routine to read a serialization trailer.
deserializeObject
public static Serializable deserializeObject(Class cl,
DataInputStream din) throws IOException
- Utility routine to deserialize a sub-object.
deserializeString
public static String deserializeString(DataInputStream din) throws IOException
- Utility routine to deserialize a String.
deserializeBoolean
public static boolean deserializeBoolean(DataInputStream din) throws IOException
- Utility routine to deserialize a boolean.
deserializeByte
public static byte deserializeByte(DataInputStream din) throws IOException
- Utility routine to deserialize a byte.
deserializeChar
public static char deserializeChar(DataInputStream din) throws IOException
- Utility routine to deserialize a char.
deserializeShort
public static short deserializeShort(DataInputStream din) throws IOException
- Utility routine to deserialize a short.
deserializeInt
public static int deserializeInt(DataInputStream din) throws IOException
- Utility routine to deserialize a int.
deserializeLong
public static long deserializeLong(DataInputStream din) throws IOException
- Utility routine to deserialize a long.
deserializeFloat
public static float deserializeFloat(DataInputStream din) throws IOException
- Utility routine to deserialize a float.
deserializeDouble
public static double deserializeDouble(DataInputStream din) throws IOException
- Utility routine to deserialize a double.
deserializeArrayObject
public static Serializable[] deserializeArrayObject(DataInputStream din) throws IOException
- Utility routine to deserialize an array of objects.
deserializeArrayByte
public static byte[] deserializeArrayByte(DataInputStream din) throws IOException
- Utility routine to deserialize an array of bytes.
deserializeArrayChar
public static char[] deserializeArrayChar(DataInputStream din) throws IOException
- Utility routine to deserialize an array of chars.
deserializeArrayShort
public static short[] deserializeArrayShort(DataInputStream din) throws IOException
- Utility routine to deserialize an array of shorts.
deserializeArrayInt
public static int[] deserializeArrayInt(DataInputStream din) throws IOException
- Utility routine to deserialize an array of ints.
deserializeArrayLong
public static long[] deserializeArrayLong(DataInputStream din) throws IOException
- Utility routine to deserialize an array of longs.
deserializeArrayFloat
public static float[] deserializeArrayFloat(DataInputStream din) throws IOException
- Utility routine to deserialize an array of floats.
deserializeArrayDouble
public static double[] deserializeArrayDouble(DataInputStream din) throws IOException
- Utility routine to deserialize an array of doubles.
main
public static void main(String args[])
- Test routine.
All Packages Class Hierarchy This Package Previous Next Index
ACME Java ACME Labs