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 LOCAL_DATE_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.
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 | |
| private Serializable | object
The object being serialized. |
| pack-priv static final byte | |
| pack-priv static final byte | |
| pack-priv static final byte | |
| private static final long | serialVersionUID
Serialization version. |
| private byte | type
The type being serialized. |
| 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 |
| Access | Constructor and Description |
|---|---|
| public | |
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv static Serializable | |
| public void | readExternal(ObjectInput
the data to read, 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 |
| pack-priv static void |
| DURATION_TYPE | back to summary |
|---|---|
| pack-priv static final byte DURATION_TYPE | |
| INSTANT_TYPE | back to summary |
|---|---|
| pack-priv static final byte INSTANT_TYPE | |
| LOCAL_DATE_TIME_TYPE | back to summary |
|---|---|
| pack-priv static final byte LOCAL_DATE_TIME_TYPE | |
| LOCAL_DATE_TYPE | back to summary |
|---|---|
| pack-priv static final byte LOCAL_DATE_TYPE | |
| LOCAL_TIME_TYPE | back to summary |
|---|---|
| pack-priv static final byte LOCAL_TIME_TYPE | |
| MONTH_DAY_TYPE | back to summary |
|---|---|
| pack-priv static final byte MONTH_DAY_TYPE | |
| object | back to summary |
|---|---|
| private Serializable object The object being serialized. | |
| OFFSET_DATE_TIME_TYPE | back to summary |
|---|---|
| pack-priv static final byte OFFSET_DATE_TIME_TYPE | |
| OFFSET_TIME_TYPE | back to summary |
|---|---|
| pack-priv static final byte OFFSET_TIME_TYPE | |
| PERIOD_TYPE | back to summary |
|---|---|
| pack-priv static final byte PERIOD_TYPE | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Serialization version. | |
| type | back to summary |
|---|---|
| private byte type The type being serialized. | |
| YEAR_MONTH_TYPE | back to summary |
|---|---|
| pack-priv static final byte YEAR_MONTH_TYPE | |
| YEAR_TYPE | back to summary |
|---|---|
| pack-priv static final byte YEAR_TYPE | |
| ZONE_DATE_TIME_TYPE | back to summary |
|---|---|
| pack-priv static final byte ZONE_DATE_TIME_TYPE | |
| ZONE_OFFSET_TYPE | back to summary |
|---|---|
| pack-priv static final byte ZONE_OFFSET_TYPE | |
| ZONE_REGION_TYPE | back to summary |
|---|---|
| pack-priv static final byte ZONE_REGION_TYPE | |
| 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 |
|---|---|
| pack-priv static void writeInternal(byte type, Object object, ObjectOutput out) throws IOException | |