me.prettyprint.cassandra.serializers
Class ObjectSerializer

java.lang.Object
  extended by me.prettyprint.cassandra.serializers.AbstractSerializer<Object>
      extended by me.prettyprint.cassandra.serializers.ObjectSerializer
All Implemented Interfaces:
Serializer<Object>

public class ObjectSerializer
extends AbstractSerializer<Object>
implements Serializer<Object>

The ObjectSerializer is used to turn objects into their binary representations.

Author:
Bozhidar Bozhanov

Constructor Summary
ObjectSerializer()
           
ObjectSerializer(ClassLoader cl)
           
 
Method Summary
 Object fromByteBuffer(ByteBuffer bytes)
          Extract an object of type T from the bytes.
static ObjectSerializer get()
           
 ByteBuffer toByteBuffer(Object obj)
          Extract bytes from the obj of type T
 
Methods inherited from class me.prettyprint.cassandra.serializers.AbstractSerializer
computeInitialHashSize, fromBytes, fromBytesList, fromBytesMap, fromBytesSet, getComparatorType, toBytes, toBytesList, toBytesMap, toBytesSet
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface me.prettyprint.hector.api.Serializer
fromBytes, fromBytesList, fromBytesMap, fromBytesSet, getComparatorType, toBytes, toBytesList, toBytesMap, toBytesSet
 

Constructor Detail

ObjectSerializer

public ObjectSerializer()

ObjectSerializer

public ObjectSerializer(ClassLoader cl)
Parameters:
cl - - the classloader to use when deserializing objects.
Method Detail

toByteBuffer

public ByteBuffer toByteBuffer(Object obj)
Description copied from interface: Serializer
Extract bytes from the obj of type T

Specified by:
toByteBuffer in interface Serializer<Object>
Specified by:
toByteBuffer in class AbstractSerializer<Object>
Returns:

fromByteBuffer

public Object fromByteBuffer(ByteBuffer bytes)
Description copied from interface: Serializer
Extract an object of type T from the bytes.

Specified by:
fromByteBuffer in interface Serializer<Object>
Specified by:
fromByteBuffer in class AbstractSerializer<Object>
Returns:

get

public static ObjectSerializer get()


Copyright © 2011. All Rights Reserved.