|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.spy.memcached.compat.SpyObject
net.spy.memcached.transcoders.BaseSerializingTranscoder
public abstract class BaseSerializingTranscoder
Base class for any transcoders that may want to work with serialized or compressed data.
Field Summary | |
---|---|
protected java.lang.String |
charset
|
protected int |
compressionThreshold
|
static int |
DEFAULT_COMPRESSION_THRESHOLD
Default compression threshold value. |
Constructor Summary | |
---|---|
BaseSerializingTranscoder(int max)
Initialize a serializing transcoder with the given maximum data size. |
Method Summary | |
---|---|
boolean |
asyncDecode(CachedData d)
|
protected byte[] |
compress(byte[] in)
Compress the given array of bytes. |
protected java.lang.String |
decodeString(byte[] data)
Decode the string with the current character set. |
protected byte[] |
decompress(byte[] in)
Decompress the given array of bytes. |
protected java.lang.Object |
deserialize(byte[] in)
Get the object represented by the given serialized bytes. |
protected byte[] |
encodeString(java.lang.String in)
Encode a string into the current character set. |
int |
getMaxSize()
|
protected byte[] |
serialize(java.lang.Object o)
Get the bytes representing the given serialized object. |
void |
setCharset(java.lang.String to)
Set the character set for string value transcoding (defaults to UTF-8). |
void |
setCompressionThreshold(int to)
Set the compression threshold to the given number of bytes. |
Methods inherited from class net.spy.memcached.compat.SpyObject |
---|
getLogger |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int DEFAULT_COMPRESSION_THRESHOLD
protected int compressionThreshold
protected java.lang.String charset
Constructor Detail |
---|
public BaseSerializingTranscoder(int max)
Method Detail |
---|
public boolean asyncDecode(CachedData d)
public void setCompressionThreshold(int to)
to
- the number of bytespublic void setCharset(java.lang.String to)
protected byte[] serialize(java.lang.Object o)
protected java.lang.Object deserialize(byte[] in)
protected byte[] compress(byte[] in)
protected byte[] decompress(byte[] in)
protected java.lang.String decodeString(byte[] data)
protected byte[] encodeString(java.lang.String in)
public int getMaxSize()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |