Implementation Note
This class wraps the object being serialized, and takes a byte representing the type of the class to
be serialized. This byte can also be used for versioning the serialization format. In this case another
byte flag would be used in order to specify an alternative version of the type format.
For example CHRONO_TYPE_VERSION_2 = 21
In order to serialize the object it writes its byte and then calls back to the appropriate class where the serialization is performed. In order to deserialize the object it read in the type byte, switching in order to select which class to call back into.
The serialization format is determined on a per class basis. In the case of field based classes each
of the fields is written out with an appropriate size format in descending order of the field's size. For
example in the case of LocalDate
year is written before month. Composite classes, such as
LocalDateTime
are serialized as one object. Enum classes are serialized using the index of their
element.
This class is mutable and should be created once per serialization.
Modifier and Type | Field and Description |
---|---|
pack-priv static final byte | |
pack-priv static final byte | |
pack-priv static final byte | |
pack-priv static final byte | |
pack-priv static final byte | |
pack-priv static final byte | |
pack-priv static final byte | |
pack-priv static final byte | |
private Serializable | object
The object being serialized. |
private static final long | serialVersionUID
Serialization version. |
pack-priv static final byte | |
private byte | type
The type being serialized. |
Access | Constructor and Description |
---|---|
public | |
pack-priv |
Modifier and Type | Method and Description |
---|---|
pack-priv static Serializable | |
public void | readExternal(ObjectInput
the data stream to read from, not null in)Implements java. Implements the |
private static Serializable | |
private Object | Returns: the read object, should never be nullReturns the object that will replace this one. |
public void | writeExternal(ObjectOutput
the data stream to write to, not null out)Implements java. Implements the |
private static void |
CHRONO_LOCAL_DATE_TIME_TYPE | back to summary |
---|---|
pack-priv static final byte CHRONO_LOCAL_DATE_TIME_TYPE |
CHRONO_PERIOD_TYPE | back to summary |
---|---|
pack-priv static final byte CHRONO_PERIOD_TYPE |
CHRONO_TYPE | back to summary |
---|---|
pack-priv static final byte CHRONO_TYPE |
CHRONO_ZONE_DATE_TIME_TYPE | back to summary |
---|---|
pack-priv static final byte CHRONO_ZONE_DATE_TIME_TYPE |
HIJRAH_DATE_TYPE | back to summary |
---|---|
pack-priv static final byte HIJRAH_DATE_TYPE |
JAPANESE_DATE_TYPE | back to summary |
---|---|
pack-priv static final byte JAPANESE_DATE_TYPE |
JAPANESE_ERA_TYPE | back to summary |
---|---|
pack-priv static final byte JAPANESE_ERA_TYPE |
MINGUO_DATE_TYPE | back to summary |
---|---|
pack-priv static final byte MINGUO_DATE_TYPE |
object | back to summary |
---|---|
private Serializable object The object being serialized. |
serialVersionUID | back to summary |
---|---|
private static final long serialVersionUID Serialization version. |
THAIBUDDHIST_DATE_TYPE | back to summary |
---|---|
pack-priv static final byte THAIBUDDHIST_DATE_TYPE |
type | back to summary |
---|---|
private byte type The type being serialized. |
Ser | back to summary |
---|---|
public Ser() Constructor for deserialization. |
Ser | back to summary |
---|---|
pack-priv Ser(byte type, Serializable object) Creates an instance for serialization.
|
read | back to summary |
---|---|
pack-priv static Serializable read(ObjectInput in) throws IOException, ClassNotFoundException |
readExternal | back to summary |
---|---|
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException Implements java. Implements the
|
readInternal | back to summary |
---|---|
private static Serializable readInternal(byte type, ObjectInput in) throws IOException, ClassNotFoundException |
readResolve | back to summary |
---|---|
private Object readResolve() Returns the object that will replace this one. |
writeExternal | back to summary |
---|---|
public void writeExternal(ObjectOutput out) throws IOException Implements java. Implements the
|
writeInternal | back to summary |
---|---|
private static void writeInternal(byte type, Object object, ObjectOutput out) throws IOException |