Package net.spy.memcached.transcoders
Class WhalinV1Transcoder
java.lang.Object
net.spy.memcached.compat.SpyObject
net.spy.memcached.transcoders.BaseSerializingTranscoder
net.spy.memcached.transcoders.WhalinV1Transcoder
- All Implemented Interfaces:
Transcoder<Object>
Handles old whalin (tested with v1.6) encoding: data type is in the first
byte of the value.
- Since:
- Oct 16, 2008
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
Fields inherited from class net.spy.memcached.transcoders.BaseSerializingTranscoder
charset, compressionThreshold, DEFAULT_COMPRESSION_THRESHOLD
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondecode
(CachedData d) Decode the cached object into the object it represents.private Boolean
decodeBoolean
(byte[] in) private Byte
decodeByte
(byte[] in) private Character
decodeCharacter
(byte[] b) private Double
decodeDouble
(byte[] in) private Float
decodeFloat
(byte[] in) private Integer
decodeInteger
(byte[] in) private Long
decodeLong
(byte[] in) private Short
decodeShort
(byte[] data) private String
decodeW1String
(byte[] b) Encode the given object for storage.private byte[]
encodeBoolean
(Boolean value) private byte[]
encodeByte
(Byte value) private byte[]
encodeCharacter
(Character value) private byte[]
encodeDouble
(Double value) private byte[]
encodeFloat
(Float value) private byte[]
encodeInteger
(Integer value) private byte[]
encodeLong
(Long value) private byte[]
encodeLong
(Long value, int type) private byte[]
encodeNum
(long l, int maxBytes) private byte[]
encodeShort
(Short value) private byte[]
encodeStringBuffer
(StringBuffer value) private byte[]
encodeStringbuilder
(StringBuilder value) private byte[]
encodeW1String
(String value) Methods inherited from class net.spy.memcached.transcoders.BaseSerializingTranscoder
asyncDecode, compress, decodeString, decompress, deserialize, encodeString, getMaxSize, serialize, setCharset, setCompressionThreshold
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.spy.memcached.transcoders.Transcoder
asyncDecode, getMaxSize
-
Field Details
-
SPECIAL_BYTE
public static final int SPECIAL_BYTE- See Also:
-
SPECIAL_BOOLEAN
public static final int SPECIAL_BOOLEAN- See Also:
-
SPECIAL_INTEGER
public static final int SPECIAL_INTEGER- See Also:
-
SPECIAL_LONG
public static final int SPECIAL_LONG- See Also:
-
SPECIAL_CHARACTER
public static final int SPECIAL_CHARACTER- See Also:
-
SPECIAL_STRING
public static final int SPECIAL_STRING- See Also:
-
SPECIAL_STRINGBUFFER
public static final int SPECIAL_STRINGBUFFER- See Also:
-
SPECIAL_FLOAT
public static final int SPECIAL_FLOAT- See Also:
-
SPECIAL_SHORT
public static final int SPECIAL_SHORT- See Also:
-
SPECIAL_DOUBLE
public static final int SPECIAL_DOUBLE- See Also:
-
SPECIAL_DATE
public static final int SPECIAL_DATE- See Also:
-
SPECIAL_STRINGBUILDER
public static final int SPECIAL_STRINGBUILDER- See Also:
-
COMPRESSED
public static final int COMPRESSED- See Also:
-
SERIALIZED
public static final int SERIALIZED- See Also:
-
-
Constructor Details
-
WhalinV1Transcoder
public WhalinV1Transcoder()
-
-
Method Details
-
encode
Description copied from interface:Transcoder
Encode the given object for storage.- Specified by:
encode
in interfaceTranscoder<Object>
- Parameters:
o
- the object- Returns:
- the CachedData representing what should be sent
-
decode
Description copied from interface:Transcoder
Decode the cached object into the object it represents.- Specified by:
decode
in interfaceTranscoder<Object>
- Parameters:
d
- the data- Returns:
- the return value
-
decodeShort
-
decodeByte
-
decodeInteger
-
decodeFloat
-
decodeDouble
-
decodeBoolean
-
decodeLong
-
decodeCharacter
-
decodeW1String
-
encodeByte
-
encodeBoolean
-
encodeInteger
-
encodeLong
-
encodeLong
-
encodeShort
-
encodeFloat
-
encodeDouble
-
encodeCharacter
-
encodeStringBuffer
-
encodeStringbuilder
-
encodeW1String
-
encodeNum
private byte[] encodeNum(long l, int maxBytes)
-