org.apache.jcs.engine.behavior
Interface IElementSerializer

All Known Implementing Classes:
CompressingSerializer, 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 a compressing standard serializer.

Author:
Aaron Smuts

Method Summary
<T extends Serializable>
T
deSerialize(byte[] bytes)
          Turns a byte array into an object.
<T extends Serializable>
byte[]
serialize(T obj)
          Turns an object into a byte array.
 

Method Detail

serialize

<T extends Serializable> byte[] serialize(T obj)
                 throws IOException
Turns an object into a byte array.

Parameters:
obj -
Returns:
byte[]
Throws:
IOException

deSerialize

<T extends Serializable> T deSerialize(byte[] bytes)
                                   throws IOException,
                                          ClassNotFoundException
Turns a byte array into an object.

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


Copyright © 2002-2013 The Apache Software Foundation. All Rights Reserved.