jdbm.helper
Class ByteArraySerializer

java.lang.Object
  extended by jdbm.helper.ByteArraySerializer
All Implemented Interfaces:
java.io.Serializable, Serializer

public final class ByteArraySerializer
extends java.lang.Object
implements Serializer

Serializer for byte arrays -- simple returns the byte array itself. No actual serialization is performed.

Version:
$Id: ByteArraySerializer.java,v 1.1 2003/03/21 02:48:42 boisvert Exp $
Author:
Alex Boisvert
See Also:
Serialized Form

Field Summary
static ByteArraySerializer INSTANCE
          Static instance.
 
Constructor Summary
ByteArraySerializer()
           
 
Method Summary
 java.lang.Object deserialize(byte[] serialized)
          Deserialize the content of an object from a byte array.
 byte[] serialize(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 ByteArraySerializer INSTANCE
Static instance.

Constructor Detail

ByteArraySerializer

public ByteArraySerializer()
Method Detail

serialize

public byte[] serialize(java.lang.Object obj)
                 throws java.io.IOException
Serialize the content of an object into a byte array.

Specified by:
serialize in interface Serializer
Parameters:
obj - Object to serialize
Returns:
a byte array representing the object's state
Throws:
java.io.IOException

deserialize

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

Specified by:
deserialize in interface Serializer
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