krati.sos
Interface ObjectSerializer<V>

Type Parameters:
V - An object to serialize or to construct.

public interface ObjectSerializer<V>

An interface for object serialization and construction (de-serialization).

Author:
jwu

Method Summary
 V construct(byte[] binary)
          Constructs (i.e., de-serializes) an object from raw data.
 byte[] serialize(V object)
          Serializes an object.
 

Method Detail

serialize

byte[] serialize(V object)
Serializes an object.

Parameters:
object - an object to be serialized by this serializer.
Returns:
a byte array which is the raw representation of an object.

construct

V construct(byte[] binary)
            throws ObjectConstructionException
Constructs (i.e., de-serializes) an object from raw data.

Parameters:
binary - raw data from which an object is constructed.
Returns:
a constructed object.
Throws:
runtime - ObjectConstructionException if the object cannot be constructed from the raw bytes.
ObjectConstructionException


Copyright © 2011. All Rights Reserved.