public abstract class NativeTypeSerializer
extends java.lang.Object
Field
).
When using this class, all writing needs to be done using the writeValue(java.lang.Object, com.goldencode.util.NativeTypeSerializer, java.io.ObjectOutput)
API and it
must be read using the readValueWorker(java.io.ObjectInput)
API.
All Java 7 native types are supported, plus String
. If the class passed to
getWorker(java.lang.Class<?>)
is not a native type or String
, then it will fallback to serializing
the value as a plain Object
.
Modifier and Type | Class and Description |
---|---|
private static class |
NativeTypeSerializer.BooleanSerializer
A serializer for native
boolean values. |
private static class |
NativeTypeSerializer.ByteSerializer
A serializer for native
byte values. |
private static class |
NativeTypeSerializer.CharSerializer
A serializer for native
char values. |
private static class |
NativeTypeSerializer.DoubleSerializer
A serializer for native
double values. |
static class |
NativeTypeSerializer.Externalizer<T extends java.io.Externalizable>
Helper class for (de)serialization classes with subclasses
|
private static class |
NativeTypeSerializer.FloatSerializer
A serializer for native
float values. |
private static class |
NativeTypeSerializer.IntSerializer
A serializer for native
int values. |
private static class |
NativeTypeSerializer.LongSerializer
A serializer for native
long values. |
private static class |
NativeTypeSerializer.ObjectSerializer
A fallback serializer for
Object instances. |
static interface |
NativeTypeSerializer.Reader<T>
Generic reader
|
private static class |
NativeTypeSerializer.ShortSerializer
A serializer for native
short values. |
private static class |
NativeTypeSerializer.StringSerializer
A serializer for
String values. |
static interface |
NativeTypeSerializer.Writer<T>
Generic reader
|
Modifier and Type | Field and Description |
---|---|
static NativeTypeSerializer.BooleanSerializer |
BOOLEAN_SERIALIZER
A serializer for native
boolean values. |
static NativeTypeSerializer.ByteSerializer |
BYTE_SERIALIZER
A serializer for native
byte values. |
static NativeTypeSerializer.CharSerializer |
CHAR_SERIALIZER
A serializer for native
char values. |
static NativeTypeSerializer.DoubleSerializer |
DOUBLE_SERIALIZER
A serializer for native
double values. |
static NativeTypeSerializer.FloatSerializer |
FLOAT_SERIALIZER
A serializer for native
float values. |
static NativeTypeSerializer.IntSerializer |
INT_SERIALIZER
A serializer for native
int values. |
static NativeTypeSerializer.LongSerializer |
LONG_SERIALIZER
A serializer for native
long values. |
protected byte |
mark
A special mark to identify the type of the written value, when reading.
|
static NativeTypeSerializer.ObjectSerializer |
OBJECT_SERIALIZER
Fallback serializer for other
Object instances. |
static NativeTypeSerializer.ShortSerializer |
SHORT_SERIALIZER
A serializer for native
short values. |
static NativeTypeSerializer.StringSerializer |
STRING_SERIALIZER
A serializer for
String values. |
private static NativeTypeSerializer[] |
workers
An array of workers, identified by their
mark . |
Modifier | Constructor and Description |
---|---|
protected |
NativeTypeSerializer(int mark)
Create a new serializer and set its mark.
|
Modifier and Type | Method and Description |
---|---|
static NativeTypeSerializer |
getWorker(java.lang.Class<?> ftype)
Get the
NativeTypeSerializer associated with the given Class . |
static <T> T[] |
readArray(java.io.ObjectInput in,
java.util.function.IntFunction<T[]> allocate,
NativeTypeSerializer.Reader<T> reader)
Read array from the ObjectInput
|
static <T extends BaseDataType> |
readBaseDataType(java.io.ObjectInput in)
Read BaseDataType from the ObjectInput
|
static java.lang.Boolean |
readBoolean(java.io.ObjectInput in)
Read Boolean from the ObjectInput
|
static java.lang.Byte |
readByte(java.io.ObjectInput in)
Read Byte from the ObjectInput
|
static byte[] |
readByteArray(java.io.ObjectInput in)
Read byte array from the ObjectInput
|
static java.lang.Double |
readDouble(java.io.ObjectInput in)
Read Double from the ObjectInput
|
static <T extends java.lang.Enum<?>> |
readEnum(java.io.ObjectInput in,
T[] values)
Read enum from the ObjectInput
|
static <T extends java.io.Externalizable> |
readExtArray(java.io.ObjectInput in,
java.util.function.IntFunction<T[]> allocate,
java.util.function.Supplier<T> init)
Read array from the ObjectInput
|
static <T extends java.io.Externalizable> |
readExternalizable(java.io.ObjectInput in,
java.util.function.Supplier<T> f)
Read Externalizable from the ObjectInput
|
static <T extends java.io.Externalizable> |
readExtNotNull(java.io.ObjectInput in,
java.util.function.Supplier<T> f)
Read not null Externalizable from the ObjectInput
|
static int[] |
readIntArray(java.io.ObjectInput in)
Read int array from the ObjectInput
|
static java.lang.Integer |
readInteger(java.io.ObjectInput in)
Read Integer from the ObjectInput
|
static java.lang.Integer[] |
readIntegerArray(java.io.ObjectInput in)
Read Integer array from the ObjectInput
|
static java.util.Set<java.lang.Integer> |
readIntSet(java.io.ObjectInput in)
Read Integer set from the ObjectInput
|
static <L extends java.util.List<T>,T> |
readList(java.io.ObjectInput in,
java.util.function.IntFunction<L> allocator,
NativeTypeSerializer.Reader<T> reader)
Read List subclass from the ObjectInput
|
static <T> java.util.List<T> |
readList(java.io.ObjectInput in,
NativeTypeSerializer.Reader<T> reader)
Read List from the ObjectInput
|
static <T extends java.io.Externalizable> |
readList(java.io.ObjectInput in,
java.util.function.Supplier<T> init)
Read List from the ObjectInput
|
static <T extends java.io.Externalizable> |
readList(java.io.ObjectInput in,
java.util.function.Supplier<T> init,
boolean notNull)
Read List from the ObjectInput
|
static java.lang.Long |
readLong(java.io.ObjectInput in)
Read Long from the ObjectInput
|
static long[] |
readLongArray(java.io.ObjectInput in)
Read short array from the ObjectInput
|
static java.util.Set<java.lang.Long> |
readLongSet(java.io.ObjectInput in)
Read Long set from the ObjectInput
|
static <M extends java.util.Map<K,V>,K,V> |
readMap(java.io.ObjectInput in,
java.util.function.Supplier<M> allocator,
NativeTypeSerializer.Reader<K> keyReader,
NativeTypeSerializer.Reader<V> valReader)
Read byte array from the ObjectInput
|
static short[] |
readShortArray(java.io.ObjectInput in)
Read short array from the ObjectInput
|
static <T extends java.io.Externalizable> |
readSparseExtArray(java.io.ObjectInput in,
java.util.function.IntFunction<T[]> allocate,
java.util.function.Supplier<T> init)
Read a sparse array from the ObjectInput, where
null elements are skipped. |
static java.lang.String |
readString(java.io.ObjectInput in)
Read String from the ObjectInput
|
static java.lang.String[] |
readStringArray(java.io.ObjectInput in)
Read String array from the ObjectInput
|
static java.util.Set<java.lang.String> |
readStringSet(java.io.ObjectInput in,
boolean notNull)
Read String set from the ObjectInput
|
static java.lang.Object |
readValue(java.io.ObjectInput in)
Read the given value using the specified
worker , from the
specified destination. |
protected abstract java.lang.Object |
readValueWorker(java.io.ObjectInput in)
A worker to read the value from the specified source.
|
static <T> void |
writeArray(java.io.ObjectOutput out,
NativeTypeSerializer.Writer<T> writer,
T[] value)
Write array to the ObjectOutput
|
static <T extends java.io.Externalizable> |
writeArray(java.io.ObjectOutput out,
T[] value)
Write array to the ObjectOutput
|
static void |
writeBaseDataType(java.io.ObjectOutput out,
BaseDataType value)
Write BaseDataType to the ObjectOutput
|
static void |
writeBoolean(java.io.ObjectOutput out,
java.lang.Boolean value)
Write Boolean to the ObjectOutput
|
static void |
writeByte(java.io.ObjectOutput out,
java.lang.Byte value)
Write Byte to the ObjectOutput
|
static void |
writeByteArray(java.io.ObjectOutput out,
byte[] a)
Write byte array to the ObjectOutput
|
static void |
writeDouble(java.io.ObjectOutput out,
java.lang.Double value)
Write Double to the ObjectOutput
|
static <T extends java.lang.Enum<?>> |
writeEnum(java.io.ObjectOutput out,
T value)
Write enum to the ObjectOutput
|
static void |
writeExternalizable(java.io.ObjectOutput out,
java.io.Externalizable value)
Write Externalizable to the ObjectOutput
|
static void |
writeIntArray(java.io.ObjectOutput out,
int[] a)
Write integer array to the ObjectOutput
|
static void |
writeInteger(java.io.ObjectOutput out,
java.lang.Integer value)
Write Integer to the ObjectOutput
|
static void |
writeIntegerArray(java.io.ObjectOutput out,
java.lang.Integer[] a)
Write Integer array to the ObjectOutput
|
static void |
writeIntSet(java.io.ObjectOutput out,
java.util.Set<java.lang.Integer> a)
Write Integer set to the ObjectOutput
|
static <T extends java.io.Externalizable> |
writeList(java.io.ObjectOutput out,
java.util.List<T> value)
Write list to the ObjectOutput
|
static <T> void |
writeList(java.io.ObjectOutput out,
NativeTypeSerializer.Writer<T> writer,
java.util.List<T> value)
Write list to the ObjectOutput
|
static void |
writeLong(java.io.ObjectOutput out,
java.lang.Long value)
Write Longr to the ObjectOutput
|
static void |
writeLongArray(java.io.ObjectOutput out,
long[] a)
Write long array to the ObjectOutput
|
static void |
writeLongSet(java.io.ObjectOutput out,
java.util.Set<java.lang.Long> a)
Write Long set to the ObjectOutput
|
static <K,V> void |
writeMap(java.io.ObjectOutput out,
java.util.Map<K,V> map,
NativeTypeSerializer.Writer<K> keyWriter,
NativeTypeSerializer.Writer<V> valWriter)
Write Map to the ObjectOutput
|
static void |
writeShortArray(java.io.ObjectOutput out,
short[] a)
Write short array to the ObjectOutput
|
static <T extends java.io.Externalizable> |
writeSparseArray(java.io.ObjectOutput out,
T[] value)
Write a sparse array to the ObjectOutput, where
null elements are skipped. |
static void |
writeString(java.io.ObjectOutput out,
java.lang.String value)
Write String to the ObjectOutput
|
static void |
writeStringArray(java.io.ObjectOutput out,
java.lang.String[] a)
Write String array to the ObjectOutput
|
static void |
writeStringSet(java.io.ObjectOutput out,
java.util.Set<java.lang.String> a)
Write String set to the ObjectOutput
|
static void |
writeValue(java.lang.Object value,
NativeTypeSerializer worker,
java.io.ObjectOutput out)
Write the given value using the specified
worker , to the
specified destination. |
protected abstract void |
writeValueWorker(java.lang.Object value,
java.io.ObjectOutput out)
A worker to write the value to the specified destination.
|
public static final NativeTypeSerializer.ByteSerializer BYTE_SERIALIZER
byte
values.public static final NativeTypeSerializer.ShortSerializer SHORT_SERIALIZER
short
values.public static final NativeTypeSerializer.IntSerializer INT_SERIALIZER
int
values.public static final NativeTypeSerializer.LongSerializer LONG_SERIALIZER
long
values.public static final NativeTypeSerializer.FloatSerializer FLOAT_SERIALIZER
float
values.public static final NativeTypeSerializer.DoubleSerializer DOUBLE_SERIALIZER
double
values.public static final NativeTypeSerializer.BooleanSerializer BOOLEAN_SERIALIZER
boolean
values.public static final NativeTypeSerializer.CharSerializer CHAR_SERIALIZER
char
values.public static final NativeTypeSerializer.StringSerializer STRING_SERIALIZER
String
values.public static final NativeTypeSerializer.ObjectSerializer OBJECT_SERIALIZER
Object
instances.private static final NativeTypeSerializer[] workers
mark
.protected final byte mark
protected NativeTypeSerializer(int mark)
mark
- The serializer's mark.public static void writeValue(java.lang.Object value, NativeTypeSerializer worker, java.io.ObjectOutput out) throws java.io.IOException
worker
, to the
specified destination.
The first written byte will be the worker's mark
, followed by the serialized value.
value
- The value to be written.worker
- The worker to write the value.out
- The destination.java.io.IOException
- In case of I/O errors.public static void writeIntArray(java.io.ObjectOutput out, int[] a) throws java.io.IOException
out
- ObjectOutput instancea
- array to be writtenjava.io.IOException
- In case of I/O errors.public static java.lang.Integer[] readIntegerArray(java.io.ObjectInput in) throws java.io.IOException
in
- ObjectInput instancejava.io.IOException
- In case of I/O errors.public static void writeIntegerArray(java.io.ObjectOutput out, java.lang.Integer[] a) throws java.io.IOException
out
- ObjectOutput instancea
- array to be writtenjava.io.IOException
- In case of I/O errors.public static int[] readIntArray(java.io.ObjectInput in) throws java.io.IOException
in
- ObjectInput instancejava.io.IOException
- In case of I/O errors.public static java.lang.String[] readStringArray(java.io.ObjectInput in) throws java.io.IOException
in
- ObjectInput instancejava.io.IOException
- In case of I/O errors.public static void writeStringArray(java.io.ObjectOutput out, java.lang.String[] a) throws java.io.IOException
out
- ObjectOutput instancea
- array to be writtenjava.io.IOException
- In case of I/O errors.public static void writeStringSet(java.io.ObjectOutput out, java.util.Set<java.lang.String> a) throws java.io.IOException
out
- ObjectOutput instancea
- set to be writtenjava.io.IOException
- In case of I/O errors.public static java.util.Set<java.lang.Integer> readIntSet(java.io.ObjectInput in) throws java.io.IOException
in
- ObjectOutput instancejava.io.IOException
- In case of I/O errors.public static void writeLongSet(java.io.ObjectOutput out, java.util.Set<java.lang.Long> a) throws java.io.IOException
out
- ObjectOutput instancea
- set to be writtenjava.io.IOException
- In case of I/O errors.public static java.util.Set<java.lang.Long> readLongSet(java.io.ObjectInput in) throws java.io.IOException
in
- ObjectOutput instancejava.io.IOException
- In case of I/O errors.public static void writeIntSet(java.io.ObjectOutput out, java.util.Set<java.lang.Integer> a) throws java.io.IOException
out
- ObjectOutput instancea
- set to be writtenjava.io.IOException
- In case of I/O errors.public static java.util.Set<java.lang.String> readStringSet(java.io.ObjectInput in, boolean notNull) throws java.io.IOException
in
- ObjectInput instancenotNull
- if true
return emptySet instead of null
java.io.IOException
- In case of I/O errors.public static <K,V> void writeMap(java.io.ObjectOutput out, java.util.Map<K,V> map, NativeTypeSerializer.Writer<K> keyWriter, NativeTypeSerializer.Writer<V> valWriter) throws java.io.IOException
K
- key typeV
- value typeout
- ObjectOutput instancemap
- array to be writtenkeyWriter
- writer for keysvalWriter
- writer for valuesjava.io.IOException
- In case of I/O errors.public static <M extends java.util.Map<K,V>,K,V> M readMap(java.io.ObjectInput in, java.util.function.Supplier<M> allocator, NativeTypeSerializer.Reader<K> keyReader, NativeTypeSerializer.Reader<V> valReader) throws java.io.IOException, java.lang.ClassNotFoundException
M
- map typeK
- key typeV
- value typein
- ObjectInput instanceallocator
- Map allocatorkeyReader
- reader for keysvalReader
- reader for valuesjava.io.IOException
- In case of I/O errors.java.lang.ClassNotFoundException
- In case when class is not found.public static void writeByteArray(java.io.ObjectOutput out, byte[] a) throws java.io.IOException
out
- ObjectOutput instancea
- array to be writtenjava.io.IOException
- In case of I/O errors.public static byte[] readByteArray(java.io.ObjectInput in) throws java.io.IOException
in
- ObjectInput instancejava.io.IOException
- In case of I/O errors.public static void writeShortArray(java.io.ObjectOutput out, short[] a) throws java.io.IOException
out
- ObjectOutput instancea
- array to be writtenjava.io.IOException
- In case of I/O errors.public static short[] readShortArray(java.io.ObjectInput in) throws java.io.IOException
in
- ObjectInput instancejava.io.IOException
- In case of I/O errors.public static void writeLongArray(java.io.ObjectOutput out, long[] a) throws java.io.IOException
out
- ObjectOutput instancea
- array to be writtenjava.io.IOException
- In case of I/O errors.public static long[] readLongArray(java.io.ObjectInput in) throws java.io.IOException
in
- ObjectInput instancejava.io.IOException
- In case of I/O errors.public static void writeInteger(java.io.ObjectOutput out, java.lang.Integer value) throws java.io.IOException
out
- ObjectOutput instancevalue
- value to be writtenjava.io.IOException
- In case of I/O errors.public static java.lang.Integer readInteger(java.io.ObjectInput in) throws java.io.IOException
in
- ObjectInput instancejava.io.IOException
- In case of I/O errors.public static void writeByte(java.io.ObjectOutput out, java.lang.Byte value) throws java.io.IOException
out
- ObjectOutput instancevalue
- value to be writtenjava.io.IOException
- In case of I/O errors.public static java.lang.Byte readByte(java.io.ObjectInput in) throws java.io.IOException
in
- ObjectInput instancejava.io.IOException
- In case of I/O errors.public static void writeLong(java.io.ObjectOutput out, java.lang.Long value) throws java.io.IOException
out
- ObjectOutput instancevalue
- value to be writtenjava.io.IOException
- In case of I/O errors.public static java.lang.Long readLong(java.io.ObjectInput in) throws java.io.IOException
in
- ObjectInput instancejava.io.IOException
- In case of I/O errors.public static void writeBoolean(java.io.ObjectOutput out, java.lang.Boolean value) throws java.io.IOException
out
- ObjectOutput instancevalue
- value to be writtenjava.io.IOException
- In case of I/O errors.public static java.lang.Boolean readBoolean(java.io.ObjectInput in) throws java.io.IOException
in
- ObjectInput instancejava.io.IOException
- In case of I/O errors.public static <T extends java.lang.Enum<?>> void writeEnum(java.io.ObjectOutput out, T value) throws java.io.IOException
T
- enum typeout
- ObjectOutput instancevalue
- value to be writtenjava.io.IOException
- In case of I/O errors.public static <T extends java.lang.Enum<?>> T readEnum(java.io.ObjectInput in, T[] values) throws java.io.IOException
T
- enum typein
- ObjectInput instancevalues
- enum values()
arrayjava.io.IOException
- In case of I/O errors.public static void writeDouble(java.io.ObjectOutput out, java.lang.Double value) throws java.io.IOException
out
- ObjectOutput instancevalue
- value to be writtenjava.io.IOException
- In case of I/O errors.public static java.lang.Double readDouble(java.io.ObjectInput in) throws java.io.IOException
in
- ObjectInput instancejava.io.IOException
- In case of I/O errors.public static <T extends java.io.Externalizable> void writeSparseArray(java.io.ObjectOutput out, T[] value) throws java.io.IOException
null
elements are skipped.T
- The array element type.out
- ObjectOutput instance.value
- The value to be written.java.io.IOException
- In case of I/O errors.public static <T extends java.io.Externalizable> void writeArray(java.io.ObjectOutput out, T[] value) throws java.io.IOException
T
- array element typeout
- ObjectOutput instancevalue
- value to be writtenjava.io.IOException
- In case of I/O errors.public static <T extends java.io.Externalizable> T[] readSparseExtArray(java.io.ObjectInput in, java.util.function.IntFunction<T[]> allocate, java.util.function.Supplier<T> init) throws java.io.IOException, java.lang.ClassNotFoundException
null
elements are skipped.T
- The array element type.in
- ObjectInput instance.allocate
- The array allocator.init
- The element default constructor.java.io.IOException
- In case of I/O errors.java.lang.ClassNotFoundException
- If the class is not found.public static <T extends java.io.Externalizable> T[] readExtArray(java.io.ObjectInput in, java.util.function.IntFunction<T[]> allocate, java.util.function.Supplier<T> init) throws java.io.IOException, java.lang.ClassNotFoundException
T
- array element typein
- ObjectInput instanceallocate
- array allocatorinit
- default constructorjava.io.IOException
- In case of I/O errors.java.lang.ClassNotFoundException
- If class is not foundpublic static <T extends java.io.Externalizable> void writeList(java.io.ObjectOutput out, java.util.List<T> value) throws java.io.IOException
T
- list element typeout
- ObjectOutput instancevalue
- value to be writtenjava.io.IOException
- In case of I/O errors.public static <T> void writeList(java.io.ObjectOutput out, NativeTypeSerializer.Writer<T> writer, java.util.List<T> value) throws java.io.IOException
T
- list element typeout
- ObjectOutput instancewriter
- writervalue
- value to be writtenjava.io.IOException
- In case of I/O errors.public static <T extends java.io.Externalizable> java.util.List<T> readList(java.io.ObjectInput in, java.util.function.Supplier<T> init) throws java.io.IOException, java.lang.ClassNotFoundException
T
- list element typein
- ObjectInput instancelocatorinit
- default constructorjava.io.IOException
- In case of I/O errors.java.lang.ClassNotFoundException
- If type is not foundpublic static <T extends java.io.Externalizable> java.util.List<T> readList(java.io.ObjectInput in, java.util.function.Supplier<T> init, boolean notNull) throws java.io.IOException, java.lang.ClassNotFoundException
T
- list element typein
- ObjectInput instancelocatorinit
- default constructornotNull
- if true
return emptyList instead of null
java.io.IOException
- In case of I/O errors.java.lang.ClassNotFoundException
- If type is not foundpublic static <T> java.util.List<T> readList(java.io.ObjectInput in, NativeTypeSerializer.Reader<T> reader) throws java.io.IOException, java.lang.ClassNotFoundException
T
- list element typein
- ObjectInput instancelocatorreader
- default constructorjava.io.IOException
- In case of I/O errors.java.lang.ClassNotFoundException
- If type is not foundpublic static <L extends java.util.List<T>,T> L readList(java.io.ObjectInput in, java.util.function.IntFunction<L> allocator, NativeTypeSerializer.Reader<T> reader) throws java.io.IOException, java.lang.ClassNotFoundException
L
- List typeT
- elements' typein
- ObjectInput instance locatorallocator
- list allocatorreader
- default constructorjava.io.IOException
- In case of I/O errors.java.lang.ClassNotFoundException
- If type is not foundpublic static <T> T[] readArray(java.io.ObjectInput in, java.util.function.IntFunction<T[]> allocate, NativeTypeSerializer.Reader<T> reader) throws java.io.IOException, java.lang.ClassNotFoundException
T
- array element typein
- ObjectInput instancelocatorallocate
- array allocatorreader
- default constructorjava.io.IOException
- In case of I/O errors.java.lang.ClassNotFoundException
- If type is not foundpublic static <T> void writeArray(java.io.ObjectOutput out, NativeTypeSerializer.Writer<T> writer, T[] value) throws java.io.IOException
T
- array element typeout
- ObjectOutput instancewriter
- writervalue
- value to be writtenjava.io.IOException
- In case of I/O errors.public static void writeExternalizable(java.io.ObjectOutput out, java.io.Externalizable value) throws java.io.IOException
out
- ObjectOutput instancevalue
- value to be writtenjava.io.IOException
- In case of I/O errors.public static <T extends java.io.Externalizable> T readExternalizable(java.io.ObjectInput in, java.util.function.Supplier<T> f) throws java.io.IOException, java.lang.ClassNotFoundException
T
- value typein
- ObjectInput instancef
- object constructorjava.io.IOException
- In case of I/O errors.java.lang.ClassNotFoundException
- If class is not foundpublic static <T extends java.io.Externalizable> T readExtNotNull(java.io.ObjectInput in, java.util.function.Supplier<T> f) throws java.io.IOException, java.lang.ClassNotFoundException
T
- value typein
- ObjectInput instancef
- object constructorjava.io.IOException
- In case of I/O errors.java.lang.ClassNotFoundException
- If class is not foundpublic static void writeString(java.io.ObjectOutput out, java.lang.String value) throws java.io.IOException
out
- ObjectOutput instancevalue
- value to be writtenjava.io.IOException
- In case of I/O errors.public static java.lang.String readString(java.io.ObjectInput in) throws java.io.IOException
in
- ObjectInput instancejava.io.IOException
- In case of I/O errors.public static void writeBaseDataType(java.io.ObjectOutput out, BaseDataType value) throws java.io.IOException
out
- ObjectOutput instancevalue
- value to be writtenjava.io.IOException
- In case of I/O errors.public static <T extends BaseDataType> T readBaseDataType(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
T
- value typein
- ObjectInput instancejava.io.IOException
- In case of I/O errors.java.lang.ClassNotFoundException
- If class is not foundpublic static java.lang.Object readValue(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
worker
, from the
specified destination.
The first read byte will be the worker's mark
, followed by the serialized value.
in
- The source.java.io.IOException
- In case of I/O errors.java.lang.ClassNotFoundException
- If the worker is NativeTypeSerializer.ObjectSerializer
and the object's class can not be found.public static NativeTypeSerializer getWorker(java.lang.Class<?> ftype)
NativeTypeSerializer
associated with the given Class
.ftype
- The class.protected abstract void writeValueWorker(java.lang.Object value, java.io.ObjectOutput out) throws java.io.IOException
value
- The value to be written.out
- The destination.java.io.IOException
- In case of I/O errors.protected abstract java.lang.Object readValueWorker(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
in
- The source.java.io.IOException
- In case of I/O errors.java.lang.ClassNotFoundException
- If the worker is NativeTypeSerializer.ObjectSerializer
and the object's class can not be found.