public class StringHandler extends Object implements DataHandler
Constructor and Description |
---|
StringHandler() |
StringHandler(boolean pisCompressed) |
Modifier and Type | Method and Description |
---|---|
Object |
deserialize(Object metaData,
byte[] b,
int offset,
int len,
ServerInfo serverInfo)
de-serialize value
|
String |
getCharEncoding() |
void |
serialize(Object data,
Object metaData,
CompressibleByteArrayOutputStream op,
ServerInfo serverInfo)
The data to serialize must be a String.
|
void |
setCharEncoding(String pcharEncoding) |
public StringHandler(boolean pisCompressed)
public StringHandler()
public void serialize(Object data, Object metaData, CompressibleByteArrayOutputStream op, ServerInfo serverInfo) throws IOException
serialize
in interface DataHandler
data
- 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
DataHandler
deserialize
in interface DataHandler
metaData
- 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-serializationpublic String getCharEncoding()
public void setCharEncoding(String pcharEncoding)
Copyright © 2013- Suresh Mahalingam. All Rights Reserved.