public interface Serializer<A>
| Modifier and Type | Interface and Description |
|---|---|
static class |
Serializer.CompressionWrapper<E>
wraps another serializer and (de)compresses its output/input
|
| Modifier and Type | Field and Description |
|---|---|
static Serializer<java.lang.Object> |
BASIC
Basic serializer for most classes in 'java.lang' and 'java.util' packages.
|
static Serializer<java.lang.Boolean> |
BOOLEAN |
static Serializer<byte[]> |
BYTE_ARRAY
Serializes `byte[]` it adds header which contains size information
|
static Serializer<byte[]> |
BYTE_ARRAY_NOSIZE
Serializes `byte[]` directly into underlying store
It does not store size, so it can not be used in Maps and other collections.
|
static Serializer<char[]> |
CHAR_ARRAY
Serializes `char[]` it adds header which contains size information
|
static Serializer<double[]> |
DOUBLE_ARRAY
Serializes `double[]` it adds header which contains size information
|
static Serializer<java.lang.Object> |
ILLEGAL_ACCESS
Always throws
IllegalAccessError when invoked. |
static Serializer<int[]> |
INT_ARRAY
Serializes `int[]` it adds header which contains size information
|
static Serializer<java.lang.Integer> |
INTEGER
Serializes Integer into 4 bytes.
|
static Serializer<java.lang.Object> |
JAVA
Serializer which uses standard Java Serialization with
ObjectInputStream and ObjectOutputStream |
static Serializer<java.lang.Long> |
LONG
Serializes Long into 8 bytes, used mainly for testing.
|
static Serializer<long[]> |
LONG_ARRAY
Serializes `long[]` it adds header which contains size information
|
static Serializer<java.lang.String> |
STRING
Serializes strings using UTF8 encoding.
|
static Serializer<java.lang.String> |
STRING_ASCII
Serializes strings using ASCII encoding (8 bit character).
|
static Serializer<java.lang.String> |
STRING_INTERN
Serializes strings using UTF8 encoding.
|
static Serializer<java.lang.String> |
STRING_NOSIZE
Serializes strings using UTF8 encoding.
|
static Serializer<java.util.UUID> |
UUID
Serializers
UUID class |
| Modifier and Type | Method and Description |
|---|---|
A |
deserialize(java.io.DataInput in,
int available)
Deserialize the content of an object from a DataInput.
|
int |
fixedSize()
Data could be serialized into record with variable size or fixed size.
|
void |
serialize(java.io.DataOutput out,
A value)
Serialize the content of an object into a ObjectOutput
|
static final Serializer<java.lang.String> STRING
static final Serializer<java.lang.String> STRING_INTERN
String.intern(),
so it could save some memory.
Stores string size so can be used as collection serializer.
Does not handle null valuesstatic final Serializer<java.lang.String> STRING_ASCII
static final Serializer<java.lang.String> STRING_NOSIZE
static final Serializer<java.lang.Long> LONG
static final Serializer<java.lang.Integer> INTEGER
static final Serializer<java.lang.Boolean> BOOLEAN
static final Serializer<java.lang.Object> ILLEGAL_ACCESS
IllegalAccessError when invoked. Useful for testing and assertions.static final Serializer<java.lang.Object> BASIC
static final Serializer<byte[]> BYTE_ARRAY
static final Serializer<byte[]> BYTE_ARRAY_NOSIZE
static final Serializer<char[]> CHAR_ARRAY
static final Serializer<int[]> INT_ARRAY
static final Serializer<long[]> LONG_ARRAY
static final Serializer<double[]> DOUBLE_ARRAY
static final Serializer<java.lang.Object> JAVA
ObjectInputStream and ObjectOutputStreamstatic final Serializer<java.util.UUID> UUID
UUID classvoid serialize(java.io.DataOutput out,
A value)
throws java.io.IOException
out - ObjectOutput to save object intovalue - Object to serializejava.io.IOExceptionA deserialize(java.io.DataInput in, int available) throws java.io.IOException
in - to read serialized data fromavailable - how many bytes are available in DataInput for reading, may be -1 (in streams) or 0 (null).java.io.IOExceptionint fixedSize()