jdbm.helper
Class DefaultSerializer

java.lang.Object
  extended by jdbm.helper.DefaultSerializer
All Implemented Interfaces:
Serializer<java.lang.Object>

public class DefaultSerializer
extends java.lang.Object
implements Serializer<java.lang.Object>

Default java serializer. Constructor is privite, use DefaultSerializer.INSTANCE

Author:
Alex Boisvert

Field Summary
static DefaultSerializer INSTANCE
           
 
Method Summary
 java.lang.Object deserialize(SerializerInput in)
          Deserialize the content of an object from a byte array.
 void serialize(SerializerOutput out, java.lang.Object obj)
          Serialize the content of an object into a byte array.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANCE

public static final DefaultSerializer INSTANCE
Method Detail

serialize

public void serialize(SerializerOutput out,
                      java.lang.Object obj)
               throws java.io.IOException
Serialize the content of an object into a byte array.

Specified by:
serialize in interface Serializer<java.lang.Object>
Parameters:
obj - Object to serialize
out - DataOutputStream to save object into
Throws:
java.io.IOException

deserialize

public java.lang.Object deserialize(SerializerInput in)
                             throws java.io.IOException
Deserialize the content of an object from a byte array.

Specified by:
deserialize in interface Serializer<java.lang.Object>
Parameters:
serialized - Byte array representation of the object
Returns:
deserialized object
Throws:
java.io.IOException


Cees de Groot (C) 2000. All rights reserved http://jdbm.sourceforge.net