public class BinaryHandler extends Object implements DataHandler
| Constructor and Description |
|---|
BinaryHandler() |
BinaryHandler(boolean pisCompressed)
Creates a Binary Handler.
|
| Modifier and Type | Method and Description |
|---|---|
Object |
deserialize(Object metaData,
byte[] b,
int offset,
int len,
ServerInfo serverInfo)
de-serialize value
|
void |
serialize(Object data,
Object metaData,
CompressibleByteArrayOutputStream op,
ServerInfo serverInfo)
The data to serialize must be a byte array.
|
public BinaryHandler(boolean pisCompressed)
pisCompressed - If the binary data should be compressedpublic BinaryHandler()
public void serialize(Object data, Object metaData, CompressibleByteArrayOutputStream op, ServerInfo serverInfo) throws IOException
serialize in interface DataHandlerdata - Data to serializemetaData - Additional Info to serialize if required by the handler like the Object Class for example.
Pass null if the Data Handler does not require addtional info.op - An output stream which can automatically compress the data in a session if it crosses a configured.
Compression ThresholdserverInfo - Redis ServerInfo containing the Redis Server detailsIOException - If there is an error during serializationpublic Object deserialize(Object metaData, byte[] b, int offset, int len, ServerInfo serverInfo) throws IOException
DataHandlerdeserialize in interface DataHandlermetaData - Additional Info to de-serialize if required by the handlerb - Byte Array containing the data from the Redis Serveroffset - Starting offset of the datalen - Length of the data in bytesserverInfo - Redis ServerInfo containing the Redis Server detailsIOException - If there is an error during de-serializationCopyright © 2013- Suresh Mahalingam. All Rights Reserved.