com.netflix.astyanax.serializers
Class BytesArraySerializer
java.lang.Object
com.netflix.astyanax.serializers.AbstractSerializer<byte[]>
com.netflix.astyanax.serializers.BytesArraySerializer
- All Implemented Interfaces:
- Serializer<byte[]>
public final class BytesArraySerializer
- extends AbstractSerializer<byte[]>
- implements Serializer<byte[]>
A BytesArraySerializer translates the byte[] to and from ByteBuffer.
Method Summary |
byte[] |
fromByteBuffer(java.nio.ByteBuffer byteBuffer)
Extract an object of type T from the bytes. |
java.nio.ByteBuffer |
fromString(java.lang.String str)
Create a ByteBuffer by first parsing the type out of a string |
static BytesArraySerializer |
get()
|
java.lang.String |
getString(java.nio.ByteBuffer byteBuffer)
|
java.nio.ByteBuffer |
toByteBuffer(byte[] obj)
Extract bytes from the obj of type T |
Methods inherited from class com.netflix.astyanax.serializers.AbstractSerializer |
computeInitialHashSize, fromBytes, fromBytesList, fromBytesMap, fromBytesSet, getComparatorType, getNext, toBytes, toBytesList, toBytesList, 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 com.netflix.astyanax.Serializer |
fromBytes, fromBytesList, fromBytesMap, fromBytesSet, getComparatorType, getNext, toBytes, toBytesList, toBytesList, toBytesList, toBytesMap, toBytesSet |
BytesArraySerializer
public BytesArraySerializer()
get
public static BytesArraySerializer get()
toByteBuffer
public java.nio.ByteBuffer toByteBuffer(byte[] obj)
- Description copied from interface:
Serializer
- Extract bytes from the obj of type T
- Specified by:
toByteBuffer
in interface Serializer<byte[]>
- Specified by:
toByteBuffer
in class AbstractSerializer<byte[]>
- Returns:
fromByteBuffer
public byte[] fromByteBuffer(java.nio.ByteBuffer byteBuffer)
- Description copied from interface:
Serializer
- Extract an object of type T from the bytes.
- Specified by:
fromByteBuffer
in interface Serializer<byte[]>
- Specified by:
fromByteBuffer
in class AbstractSerializer<byte[]>
- Returns:
fromString
public java.nio.ByteBuffer fromString(java.lang.String str)
- Description copied from interface:
Serializer
- Create a ByteBuffer by first parsing the type out of a string
- Specified by:
fromString
in interface Serializer<byte[]>
- Overrides:
fromString
in class AbstractSerializer<byte[]>
- Returns:
getString
public java.lang.String getString(java.nio.ByteBuffer byteBuffer)
- Specified by:
getString
in interface Serializer<byte[]>
- Overrides:
getString
in class AbstractSerializer<byte[]>