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
 Object deSerialize(byte[] bytes)
          Turns a byte array into an object.
 byte[] serialize(Serializable obj)
          Turns an object into a byte array.
 

Method Detail

serialize

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

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

deSerialize

Object 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-2012 Apache Software Foundation. All Rights Reserved.