org.apache.jcs.engine.behavior
Interface IElementSerializer

All Known Implementing Classes:
StandardSerializer

public interface IElementSerializer

Defines the behavior for cache element serializers. This layer of abstraction allows us to plug in different serialization mechanisms, such as XStream.

Author:
Aaron Smuts

Method Summary
 java.lang.Object deSerialize(byte[] bytes)
          Turns a byte array into an object.
 byte[] serialize(java.io.Serializable obj)
          Turns an object into a byte array.
 

Method Detail

serialize

public byte[] serialize(java.io.Serializable obj)
                 throws java.io.IOException
Turns an object into a byte array.

Parameters:
obj -
Returns:
Throws:
java.io.IOException

deSerialize

public java.lang.Object deSerialize(byte[] bytes)
                             throws java.io.IOException,
                                    java.lang.ClassNotFoundException
Turns a byte array into an object.

Parameters:
bytes -
Returns:
Throws:
java.io.IOException
java.lang.ClassNotFoundException - thrown if we don't know the object.


Copyright © 2002-2007 Apache Software Foundation. All Rights Reserved.