public class NativeHandler extends Object
| Constructor and Description |
|---|
NativeHandler() |
| Modifier and Type | Method and Description |
|---|---|
static Object |
decode(byte[] b,
int flag)
Decodes byte array using memcache flag to determine type.
|
protected static Boolean |
decodeBoolean(byte[] b) |
protected static Byte |
decodeByte(byte[] b) |
protected static byte[] |
decodeByteArr(byte[] b) |
protected static Character |
decodeCharacter(byte[] b) |
protected static Date |
decodeDate(byte[] b) |
protected static Double |
decodeDouble(byte[] b) |
protected static Float |
decodeFloat(byte[] b) |
protected static Integer |
decodeInteger(byte[] b) |
protected static Long |
decodeLong(byte[] b) |
protected static Short |
decodeShort(byte[] b) |
protected static String |
decodeString(byte[] b) |
protected static StringBuffer |
decodeStringBuffer(byte[] b) |
protected static StringBuilder |
decodeStringBuilder(byte[] b) |
protected static byte[] |
encode(Boolean value) |
protected static byte[] |
encode(Byte value) |
protected static byte[] |
encode(byte[] value) |
protected static byte[] |
encode(Character value) |
protected static byte[] |
encode(Date value) |
protected static byte[] |
encode(double value) |
protected static byte[] |
encode(float value) |
protected static byte[] |
encode(int value) |
protected static byte[] |
encode(long value) |
static byte[] |
encode(Object value)
Encodes supported types
|
protected static byte[] |
encode(Short value) |
protected static byte[] |
encode(String value) |
protected static byte[] |
encode(StringBuffer value) |
protected static byte[] |
encode(StringBuilder value) |
protected static byte[] |
getBytes(int value) |
protected static byte[] |
getBytes(long value) |
static int |
getMarkerFlag(Object value)
Returns the flag for marking the type of the byte array.
|
static boolean |
isHandled(int flag) |
static boolean |
isHandled(Object value)
Detemine of object can be natively serialized by this class.
|
protected static int |
toInt(byte[] b)
This works by taking each of the bit patterns and converting them to ints
taking into account 2s complement and then adding them..
|
protected static long |
toLong(byte[] b) |
public static final boolean isHandled(Object value)
value - Object to test.public static final boolean isHandled(int flag)
public static final int getMarkerFlag(Object value)
value - Object we are storing.public static byte[] encode(Object value) throws UnsupportedEncodingException
value - Object to encode.UnsupportedEncodingException - If fail to encode.protected static byte[] encode(Byte value)
protected static byte[] encode(Boolean value)
protected static byte[] encode(int value)
protected static byte[] encode(long value)
throws UnsupportedEncodingException
UnsupportedEncodingExceptionprotected static byte[] encode(Date value)
protected static byte[] encode(Character value)
protected static byte[] encode(String value) throws UnsupportedEncodingException
UnsupportedEncodingExceptionprotected static byte[] encode(StringBuffer value) throws UnsupportedEncodingException
UnsupportedEncodingExceptionprotected static byte[] encode(float value)
throws UnsupportedEncodingException
UnsupportedEncodingExceptionprotected static byte[] encode(Short value) throws UnsupportedEncodingException
UnsupportedEncodingExceptionprotected static byte[] encode(double value)
throws UnsupportedEncodingException
UnsupportedEncodingExceptionprotected static byte[] encode(StringBuilder value) throws UnsupportedEncodingException
UnsupportedEncodingExceptionprotected static byte[] encode(byte[] value)
protected static byte[] getBytes(long value)
protected static byte[] getBytes(int value)
public static Object decode(byte[] b, int flag) throws UnsupportedEncodingException
b - marker - UnsupportedEncodingExceptionprotected static Byte decodeByte(byte[] b)
protected static Boolean decodeBoolean(byte[] b)
protected static Integer decodeInteger(byte[] b)
protected static Long decodeLong(byte[] b) throws UnsupportedEncodingException
UnsupportedEncodingExceptionprotected static Character decodeCharacter(byte[] b)
protected static String decodeString(byte[] b) throws UnsupportedEncodingException
UnsupportedEncodingExceptionprotected static StringBuffer decodeStringBuffer(byte[] b) throws UnsupportedEncodingException
UnsupportedEncodingExceptionprotected static Float decodeFloat(byte[] b) throws UnsupportedEncodingException
UnsupportedEncodingExceptionprotected static Short decodeShort(byte[] b) throws UnsupportedEncodingException
UnsupportedEncodingExceptionprotected static Double decodeDouble(byte[] b) throws UnsupportedEncodingException
UnsupportedEncodingExceptionprotected static Date decodeDate(byte[] b)
protected static StringBuilder decodeStringBuilder(byte[] b) throws UnsupportedEncodingException
UnsupportedEncodingExceptionprotected static byte[] decodeByteArr(byte[] b)
protected static int toInt(byte[] b)
b - protected static long toLong(byte[] b)
Copyright © 2013 Schooner Information Technology. All Rights Reserved.