public class MemcacheSerialization
extends java.lang.Object
MemcacheServiceImpl
and
com.google.appengine.api.memcache.dev.LocalMemcacheService
.
This class is thread-safe.
Modifier and Type | Class and Description |
---|---|
static class
|
MemcacheSerialization.Flag
Values used as flags on the MemcacheService's values.
|
static class
|
MemcacheSerialization.ValueAndFlags
Tuple of a serialized byte array value and associated flags to interpret
that value.
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String
|
USE_THREAD_CONTEXT_CLASSLOADER_PROPERTY
|
Modifier and Type | Method and Description |
---|---|
static java.lang.Object
|
deserialize
(byte[] value,
int flags)
Deserialize the object, according to its flags.
|
static byte[]
|
makePbKey
(java.lang.Object key)
Converts the user's key Object into a byte[] for the MemcacheGetRequest.
|
static
MemcacheSerialization.ValueAndFlags
|
serialize
(java.lang.Object value)
|
public static final java.lang.String USE_THREAD_CONTEXT_CLASSLOADER_PROPERTY
public static java.lang.Object deserialize(byte[] value, int flags) throws java.lang.ClassNotFoundException, java.io.IOException
value
-
flags
-
java.lang.ClassNotFoundException
- if the object can't be re-instantiated due
to being an unlocatable type
java.io.IOException
- if the object can't be re-instantiated for some other
reason
public static byte[] makePbKey(java.lang.Object key) throws java.io.IOException
String
,
Boolean
, and the
fixed-point numbers), we use a human-readable representation.
key
-
null
, the hash is also
null
.
java.io.IOException
public static MemcacheSerialization.ValueAndFlags serialize(java.lang.Object value) throws java.io.IOException
value
-
java.io.IOException
- for serialization errors, normally due to a
non-serializable object type