com.bigdata.rawstore
Interface IStoreSerializer

All Known Subinterfaces:
IAtomicStore, IBufferStrategy, IDiskBasedStrategy, IJournal, IRawStore, IUpdateStore
All Known Implementing Classes:
AbstractBufferStrategy, AbstractJournal, AbstractRawStore, AbstractRawWormStore, BasicBufferStrategy, BufferedDiskStrategy, DirectBufferStrategy, DiskBackedBufferStrategy, DiskOnlyStrategy, IndexSegmentStore, Journal, MappedBufferStrategy, SimpleMemoryRawStore, StoreManager.ManagedJournal, StoreSerializer, TemporaryRawStore, TemporaryStore, TransientBufferStrategy

public interface IStoreSerializer

An interface that encapsulates behaviors for (de-)serialization of objects on an IRawStore.

Note that the methods declared on this interface MUST construct ObjectOutputStreams that implement IStoreObjectOutputStream and ObjectInputStreams that implement IStoreObjectInputStream thereby make the IRawStore reference available during (de-)serialization. This constraint makes it possible to utilize the IAddressManager for the store during (de-)serialization.

Version:
$Id: IStoreSerializer.java 2265 2009-10-26 12:51:06Z thompsonbry $
Author:
Bryan Thompson
TODO:
this is not being used much (or perhaps at all) at this time and needs to be looked into again. The main use case is the child addresses for the nodes of a BTree. See NodeSerializer and IAddressSerializer.

Method Summary
 Object deserialize(byte[] b)
          De-serialize an object using the Java serialization mechanisms.
 Object deserialize(byte[] b, int off, int len)
          De-serialize an object using the Java serialization mechanisms.
 Object deserialize(ByteBuffer buf)
          De-serialize an object using the Java serialization mechanisms.
 byte[] serialize(Object obj)
          Serialize an object using the Java serialization mechanisms.
 

Method Detail

serialize

byte[] serialize(Object obj)
Serialize an object using the Java serialization mechanisms.

Parameters:
obj - A Serializable object.
Returns:
The serialized object state.

deserialize

Object deserialize(byte[] b)
De-serialize an object using the Java serialization mechanisms.

Parameters:
b - A byte[] containing a serialized object.
Returns:
The de-serialized object.

deserialize

Object deserialize(byte[] b,
                   int off,
                   int len)
De-serialize an object using the Java serialization mechanisms.

Parameters:
b - A byte[] containing a serialized object.
off - The offset of the first byte to de-serialize.
len - The #of bytes in the object record.
Returns:
The de-serialized object.

deserialize

Object deserialize(ByteBuffer buf)
De-serialize an object using the Java serialization mechanisms.

Parameters:
buf - A buffer containing a serialized object. The bytes from Buffer.position() to Buffer.limit() will be de-serialized and the position will be advanced to the limit.
Returns:
The de-serialized object.


Copyright © 2006-2009 SYSTAP, LLC. All Rights Reserved.