Package org.threeten.bp.zone
Class Ser
java.lang.Object
org.threeten.bp.zone.Ser
- All Implemented Interfaces:
Externalizable,Serializable
The shared serialization delegate for this package.
Implementation notes
This class is mutable and should be created once per serialization.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ObjectThe object being serialized.private static final longSerialization version.(package private) static final byteType for StandardZoneRules.private byteThe type being serialized.(package private) static final byteType for ZoneOffsetTransition.(package private) static final byteType for ZoneOffsetTransition. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static Object(package private) static longReads the state from the stream.voidImplements theExternalizableinterface to read the object.private static ObjectreadInternal(byte type, DataInput in) (package private) static ZoneOffsetreadOffset(DataInput in) Reads the state from the stream.private ObjectReturns the object that will replace this one.(package private) static voidwrite(Object object, DataOutput out) (package private) static voidwriteEpochSec(long epochSec, DataOutput out) Writes the state to the stream.voidImplements theExternalizableinterface to write the object.private static voidwriteInternal(byte type, Object object, DataOutput out) (package private) static voidwriteOffset(ZoneOffset offset, DataOutput out) Writes the state to the stream.
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDSerialization version.- See Also:
-
SZR
static final byte SZRType for StandardZoneRules.- See Also:
-
ZOT
static final byte ZOTType for ZoneOffsetTransition.- See Also:
-
ZOTRULE
static final byte ZOTRULEType for ZoneOffsetTransition.- See Also:
-
type
private byte typeThe type being serialized. -
object
The object being serialized.
-
-
Constructor Details
-
Ser
public Ser()Constructor for deserialization. -
Ser
Ser(byte type, Object object) Creates an instance for serialization.- Parameters:
type- the typeobject- the object
-
-
Method Details
-
writeExternal
Implements theExternalizableinterface to write the object.- Specified by:
writeExternalin interfaceExternalizable- Parameters:
out- the data stream to write to, not null- Throws:
IOException
-
write
- Throws:
IOException
-
writeInternal
- Throws:
IOException
-
readExternal
Implements theExternalizableinterface to read the object.- Specified by:
readExternalin interfaceExternalizable- Parameters:
in- the data to read, not null- Throws:
IOExceptionClassNotFoundException
-
read
- Throws:
IOExceptionClassNotFoundException
-
readInternal
private static Object readInternal(byte type, DataInput in) throws IOException, ClassNotFoundException - Throws:
IOExceptionClassNotFoundException
-
readResolve
Returns the object that will replace this one.- Returns:
- the read object, should never be null
-
writeOffset
Writes the state to the stream.- Parameters:
offset- the offset, not nullout- the output stream, not null- Throws:
IOException- if an error occurs
-
readOffset
Reads the state from the stream.- Parameters:
in- the input stream, not null- Returns:
- the created object, not null
- Throws:
IOException- if an error occurs
-
writeEpochSec
Writes the state to the stream.- Parameters:
epochSec- the epoch seconds, not nullout- the output stream, not null- Throws:
IOException- if an error occurs
-
readEpochSec
Reads the state from the stream.- Parameters:
in- the input stream, not null- Returns:
- the epoch seconds, not null
- Throws:
IOException- if an error occurs
-