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.
- Author:
- Patricio Echague
Methods inherited from class com.netflix.astyanax.serializers.AbstractSerializer |
computeInitialHashSize, fromBytes, fromBytesList, fromBytesMap, fromBytesSet, getComparatorType, getNext, toBytes, 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, toBytesMap, toBytesSet |
BytesArraySerializer
public BytesArraySerializer()
get
public static BytesArraySerializer get()
toByteBuffer
public 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(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 ByteBuffer fromString(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 String getString(ByteBuffer byteBuffer)
- Specified by:
getString
in interface Serializer<byte[]>
- Overrides:
getString
in class AbstractSerializer<byte[]>
Copyright © 2012. All Rights Reserved.