Top Description Fields Constructors Methods
java.time.zone

pack-priv final Class Ser

extends Object
implements Externalizable
Class Inheritance
All Implemented Interfaces
java.io.Externalizable, java.io.Serializable
Imports
java.io.DataInput, .DataOutput, .Externalizable, .IOException, .InvalidClassException, .ObjectInput, .ObjectOutput, .Serializable, .StreamCorruptedException, java.time.ZoneOffset

The shared serialization delegate for this package.

Implementation Note

This class is mutable and should be created once per serialization.

Since
1.8

Field Summary

Modifier and TypeField and Description
private Serializable
object

The object being serialized.

private static final long
serialVersionUID

Serialization version.

private byte
type

The type being serialized.

pack-priv static final byte
ZOT

Type for ZoneOffsetTransition.

pack-priv static final byte
ZOTRULE

Type for ZoneOffsetTransitionRule.

pack-priv static final byte
ZRULES

Type for ZoneRules.

Constructor Summary

AccessConstructor and Description
public
Ser()

Constructor for deserialization.

pack-priv
Ser(byte
the type
type
,
Serializable
the object
object
)

Creates an instance for serialization.

Method Summary

Modifier and TypeMethod and Description
pack-priv static Serializable
pack-priv static long

Returns:

the epoch seconds, not null
readEpochSec
(DataInput
the input stream, not null
in
)

Reads the state from the stream.

public void
readExternal(ObjectInput
the data to read, not null
in
)

Implements java.io.Externalizable.readExternal.

Implements the Externalizable interface to read the object.
private static Serializable
readInternal(byte type, DataInput in)

pack-priv static ZoneOffset

Returns:

the created object, not null
readOffset
(DataInput
the input stream, not null
in
)

Reads the state from the stream.

private Object

Returns:

the read object, should never be null
readResolve
()

Returns the object that will replace this one.

pack-priv static void
write(Object object, DataOutput out)

pack-priv static void
writeEpochSec(long
the epoch seconds, not null
epochSec
,
DataOutput
the output stream, not null
out
)

Writes the state to the stream.

public void
writeExternal(ObjectOutput
the data stream to write to, not null
out
)

Implements java.io.Externalizable.writeExternal.

Implements the Externalizable interface to write the object.
private static void
writeInternal(byte type, Object object, DataOutput out)

pack-priv static void
writeOffset(ZoneOffset
the offset, not null
offset
,
DataOutput
the output stream, not null
out
)

Writes the state to the stream.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

objectback to summary
private Serializable object

The object being serialized.

serialVersionUIDback to summary
private static final long serialVersionUID

Serialization version.

typeback to summary
private byte type

The type being serialized.

ZOTback to summary
pack-priv static final byte ZOT

Type for ZoneOffsetTransition.

ZOTRULEback to summary
pack-priv static final byte ZOTRULE

Type for ZoneOffsetTransitionRule.

ZRULESback to summary
pack-priv static final byte ZRULES

Type for ZoneRules.

Constructor Detail

Serback to summary
public Ser()

Constructor for deserialization.

Serback to summary
pack-priv Ser(byte type, Serializable object)

Creates an instance for serialization.

Parameters
type:byte

the type

object:Serializable

the object

Method Detail

readback to summary
pack-priv static Serializable read(DataInput in) throws IOException, ClassNotFoundException
readEpochSecback to summary
pack-priv static long readEpochSec(DataInput in) throws IOException

Reads the state from the stream.

Parameters
in:DataInput

the input stream, not null

Returns:long

the epoch seconds, not null

Exceptions
IOException:
if an error occurs
readExternalback to summary
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException

Implements java.io.Externalizable.readExternal.

Implements the Externalizable interface to read the object.

Parameters
in:ObjectInput

the data to read, not null

Annotations
@Override
Exceptions
IOException:

Doc from java.io.Externalizable.readExternal.

if I/O errors occur

ClassNotFoundException:

Doc from java.io.Externalizable.readExternal.

If the class for an object being restored cannot be found.

Serial data
The streamed type and parameters defined by the type's writeReplace method are read and passed to the corresponding static factory for the type to create a new instance. That instance is returned as the de-serialized Ser object.
  • ZoneRules - ZoneRules.of(standardTransitions, standardOffsets, savingsInstantTransitions, wallOffsets, lastRules);
  • ZoneOffsetTransition - ZoneOffsetTransition of(LocalDateTime.ofEpochSecond(epochSecond), offsetBefore, offsetAfter);
  • ZoneOffsetTransitionRule - ZoneOffsetTransitionRule.of(month, dom, dow, time, timeEndOfDay, timeDefinition, standardOffset, offsetBefore, offsetAfter);
readInternalback to summary
private static Serializable readInternal(byte type, DataInput in) throws IOException, ClassNotFoundException
readOffsetback to summary
pack-priv static ZoneOffset readOffset(DataInput in) throws IOException

Reads the state from the stream.

Parameters
in:DataInput

the input stream, not null

Returns:ZoneOffset

the created object, not null

Exceptions
IOException:
if an error occurs
readResolveback to summary
private Object readResolve()

Returns the object that will replace this one.

Returns:Object

the read object, should never be null

writeback to summary
pack-priv static void write(Object object, DataOutput out) throws IOException
writeEpochSecback to summary
pack-priv static void writeEpochSec(long epochSec, DataOutput out) throws IOException

Writes the state to the stream.

Parameters
epochSec:long

the epoch seconds, not null

out:DataOutput

the output stream, not null

Exceptions
IOException:
if an error occurs
writeExternalback to summary
public void writeExternal(ObjectOutput out) throws IOException

Implements java.io.Externalizable.writeExternal.

Implements the Externalizable interface to write the object.

Parameters
out:ObjectOutput

the data stream to write to, not null

Annotations
@Override
Exceptions
IOException:

Doc from java.io.Externalizable.writeExternal.

Includes any I/O exceptions that may occur

Serial data
Each serializable class is mapped to a type that is the first byte in the stream. Refer to each class writeReplace serialized form for the value of the type and sequence of values for the type.
writeInternalback to summary
private static void writeInternal(byte type, Object object, DataOutput out) throws IOException
writeOffsetback to summary
pack-priv static void writeOffset(ZoneOffset offset, DataOutput out) throws IOException

Writes the state to the stream.

Parameters
offset:ZoneOffset

the offset, not null

out:DataOutput

the output stream, not null

Exceptions
IOException:
if an error occurs