net.spy.memcached.transcoders
Class TranscoderUtils
java.lang.Object
net.spy.memcached.transcoders.TranscoderUtils
public final class TranscoderUtils
- extends Object
Utility class for transcoding Java types.
Constructor Summary |
TranscoderUtils(boolean pack)
Get an instance of TranscoderUtils. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TranscoderUtils
public TranscoderUtils(boolean pack)
- Get an instance of TranscoderUtils.
- Parameters:
pack
- if true, remove all zero bytes from the MSB of the packed num
encodeNum
public byte[] encodeNum(long l,
int maxBytes)
encodeLong
public byte[] encodeLong(long l)
decodeLong
public long decodeLong(byte[] b)
encodeInt
public byte[] encodeInt(int in)
decodeInt
public int decodeInt(byte[] in)
encodeByte
public byte[] encodeByte(byte in)
decodeByte
public byte decodeByte(byte[] in)
encodeBoolean
public byte[] encodeBoolean(boolean b)
decodeBoolean
public boolean decodeBoolean(byte[] in)