T
- base typepublic static class NativeTypeSerializer.Externalizer<T extends java.io.Externalizable>
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private java.lang.Class<? extends T> |
base |
private java.lang.Class<? extends T>[] |
subclasses |
Constructor and Description |
---|
Externalizer(java.lang.Class<? extends T>... subclasses)
Constructor
|
Modifier and Type | Method and Description |
---|---|
T |
read(java.io.ObjectInput in)
Read instance of the base class subclass from the input stream
|
private byte |
type(T val)
Get type code of the value
|
void |
write(java.io.ObjectOutput out,
T val)
Write instance of the base class subclass to the output stream
|
private final java.lang.Class<? extends T extends java.io.Externalizable> base
private final java.lang.Class<? extends T extends java.io.Externalizable>[] subclasses
public Externalizer(java.lang.Class<? extends T>... subclasses)
subclasses
- possible subclasses of the base classpublic void write(java.io.ObjectOutput out, T val) throws java.io.IOException
out
- output streamval
- value to be writtenjava.io.IOException
- In case of I/O errorpublic T read(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
in
- input streamjava.io.IOException
- In case of I/O errorjava.lang.ClassNotFoundException
- If class is not foundprivate byte type(T val)
val
- value