Package org.threeten.bp.chrono
Class Ser
- java.lang.Object
-
- org.threeten.bp.chrono.Ser
-
- All Implemented Interfaces:
java.io.Externalizable,java.io.Serializable
final class Ser extends java.lang.Object implements java.io.ExternalizableThe shared serialization delegate for this package.Implementation notes
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 exampleJAPANESE_DATE_TYPE_VERSION_2 = 21.In order to serialise the object it writes its byte and then calls back to the appropriate class where the serialisation is performed. In order to deserialise the object it read in the type byte, switching in order to select which class to call back into.
The serialisation 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
LocalDateyear is written before month. Composite classes, such asLocalDateTimeare serialised as one object.This class is mutable and should be created once per serialization.
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static byteCHRONO_LOCALDATETIME_TYPE(package private) static byteCHRONO_TYPE(package private) static byteCHRONO_ZONEDDATETIME_TYPE(package private) static byteHIJRAH_DATE_TYPE(package private) static byteHIJRAH_ERA_TYPE(package private) static byteJAPANESE_DATE_TYPE(package private) static byteJAPANESE_ERA_TYPE(package private) static byteMINGUO_DATE_TYPE(package private) static byteMINGUO_ERA_TYPEprivate java.lang.ObjectobjectThe object being serialized.private static longserialVersionUIDSerialization version.(package private) static byteTHAIBUDDHIST_DATE_TYPE(package private) static byteTHAIBUDDHIST_ERA_TYPEprivate bytetypeThe type being serialized.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) static java.lang.Objectread(java.io.ObjectInput in)voidreadExternal(java.io.ObjectInput in)Implements theExternalizableinterface to read the object.private static java.lang.ObjectreadInternal(byte type, java.io.ObjectInput in)private java.lang.ObjectreadResolve()Returns the object that will replace this one.voidwriteExternal(java.io.ObjectOutput out)Implements theExternalizableinterface to write the object.private static voidwriteInternal(byte type, java.lang.Object object, java.io.ObjectOutput out)
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
Serialization version.- See Also:
- Constant Field Values
-
JAPANESE_DATE_TYPE
static final byte JAPANESE_DATE_TYPE
- See Also:
- Constant Field Values
-
JAPANESE_ERA_TYPE
static final byte JAPANESE_ERA_TYPE
- See Also:
- Constant Field Values
-
HIJRAH_DATE_TYPE
static final byte HIJRAH_DATE_TYPE
- See Also:
- Constant Field Values
-
HIJRAH_ERA_TYPE
static final byte HIJRAH_ERA_TYPE
- See Also:
- Constant Field Values
-
MINGUO_DATE_TYPE
static final byte MINGUO_DATE_TYPE
- See Also:
- Constant Field Values
-
MINGUO_ERA_TYPE
static final byte MINGUO_ERA_TYPE
- See Also:
- Constant Field Values
-
THAIBUDDHIST_DATE_TYPE
static final byte THAIBUDDHIST_DATE_TYPE
- See Also:
- Constant Field Values
-
THAIBUDDHIST_ERA_TYPE
static final byte THAIBUDDHIST_ERA_TYPE
- See Also:
- Constant Field Values
-
CHRONO_TYPE
static final byte CHRONO_TYPE
- See Also:
- Constant Field Values
-
CHRONO_LOCALDATETIME_TYPE
static final byte CHRONO_LOCALDATETIME_TYPE
- See Also:
- Constant Field Values
-
CHRONO_ZONEDDATETIME_TYPE
static final byte CHRONO_ZONEDDATETIME_TYPE
- See Also:
- Constant Field Values
-
type
private byte type
The type being serialized.
-
object
private java.lang.Object object
The object being serialized.
-
-
Method Detail
-
writeExternal
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOExceptionImplements theExternalizableinterface to write the object.- Specified by:
writeExternalin interfacejava.io.Externalizable- Parameters:
out- the data stream to write to, not null- Throws:
java.io.IOException
-
writeInternal
private static void writeInternal(byte type, java.lang.Object object, java.io.ObjectOutput out) throws java.io.IOException- Throws:
java.io.IOException
-
readExternal
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundExceptionImplements theExternalizableinterface to read the object.- Specified by:
readExternalin interfacejava.io.Externalizable- Parameters:
in- the data to read, not null- Throws:
java.io.IOExceptionjava.lang.ClassNotFoundException
-
read
static java.lang.Object read(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException- Throws:
java.io.IOExceptionjava.lang.ClassNotFoundException
-
readInternal
private static java.lang.Object readInternal(byte type, java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException- Throws:
java.io.IOExceptionjava.lang.ClassNotFoundException
-
readResolve
private java.lang.Object readResolve()
Returns the object that will replace this one.- Returns:
- the read object, should never be null
-
-