APIdia Launch Partner
Top Description Inners Fields Constructors Methods
java.io

pack-priv final Class ObjectStreamReflection

extends Object
Class Inheritance
Imports
java.lang.invoke.MethodHandle, .MethodHandles, .MethodType, jdk.internal.access.JavaObjectStreamReflectionAccess, .SharedSecrets, jdk.internal.util.ByteArray

Utilities relating to serialization and deserialization of objects.

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class

Field Summary

Modifier and TypeField and Description
private static final MethodHandle
private static final MethodHandle

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
private static void
defaultReadObject(ObjectStreamClass
the object stream class of the object (must not be null)
streamClass
,
Object
the object to deserialize (must not be null)
obj
,
ObjectInputStream
the object stream (must not be null)
ois
)

Populate a serializable object from data acquired from the stream's java.io.ObjectInputStream.GetField object independently of the actual ObjectInputStream implementation which may arbitrarily override the ObjectInputStream#readFields() method in order to deserialize using a custom object format.

private static void
defaultWriteObject(ObjectStreamClass
the object stream class of the object (must not be null)
streamClass
,
Object
the object to serialize (must not be null)
obj
,
ObjectOutputStream
the object stream (must not be null)
oos
)

Populate and write a stream's java.io.ObjectOutputStream.PutField object from field data acquired from a serializable object independently of the actual ObjectOutputStream implementation which may arbitrarily override the ObjectOutputStream#putFields() and ObjectOutputStream#writeFields() methods in order to deserialize using a custom object format.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

DRO_HANDLEback to summary
private static final MethodHandle DRO_HANDLE
DWO_HANDLEback to summary
private static final MethodHandle DWO_HANDLE

Constructor Detail

ObjectStreamReflectionback to summary
pack-priv ObjectStreamReflection()

Method Detail

defaultReadObjectback to summary
private static void defaultReadObject(ObjectStreamClass streamClass, Object obj, ObjectInputStream ois) throws IOException, ClassNotFoundException

Populate a serializable object from data acquired from the stream's java.io.ObjectInputStream.GetField object independently of the actual ObjectInputStream implementation which may arbitrarily override the ObjectInputStream#readFields() method in order to deserialize using a custom object format.

The fields are populated using the mechanism defined in ObjectStreamClass, which requires objects and primitives to each be packed into a separate array whose relative field offsets are defined in the ObjectStreamField corresponding to each field. Utility methods on the ObjectStreamClass instance are then used to validate and perform the actual field accesses.

Parameters
streamClass:ObjectStreamClass

the object stream class of the object (must not be null)

obj:Object

the object to deserialize (must not be null)

ois:ObjectInputStream

the object stream (must not be null)

Exceptions
IOException:
if the call to ObjectInputStream#readFields or one of its field accessors throws this exception type
ClassNotFoundException:
if the call to ObjectInputStream#readFields or one of its field accessors throws this exception type
defaultWriteObjectback to summary
private static void defaultWriteObject(ObjectStreamClass streamClass, Object obj, ObjectOutputStream oos) throws IOException

Populate and write a stream's java.io.ObjectOutputStream.PutField object from field data acquired from a serializable object independently of the actual ObjectOutputStream implementation which may arbitrarily override the ObjectOutputStream#putFields() and ObjectOutputStream#writeFields() methods in order to deserialize using a custom object format.

The fields are accessed using the mechanism defined in ObjectStreamClass, which causes objects and primitives to each be packed into a separate array whose relative field offsets are defined in the ObjectStreamField corresponding to each field.

Parameters
streamClass:ObjectStreamClass

the object stream class of the object (must not be null)

obj:Object

the object to serialize (must not be null)

oos:ObjectOutputStream

the object stream (must not be null)

Exceptions
IOException:
if the call to ObjectInputStream#readFields or one of its field accessors throws this exception type
java.io back to summary

pack-priv final Class ObjectStreamReflection.Access

extends Object
implements JavaObjectStreamReflectionAccess
Class Inheritance
All Implemented Interfaces
jdk.internal.access.JavaObjectStreamReflectionAccess

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public MethodHandle
public MethodHandle
private static MethodHandle
handleForClass(final MethodHandle handle, final Class<?> clazz, final Class<?> ioClass)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

Accessback to summary
pack-priv Access()

Method Detail

defaultReadObjectback to summary
public MethodHandle defaultReadObject(Class<?> clazz)

Implements jdk.internal.access.JavaObjectStreamReflectionAccess.defaultReadObject.

defaultWriteObjectback to summary
public MethodHandle defaultWriteObject(Class<?> clazz)

Implements jdk.internal.access.JavaObjectStreamReflectionAccess.defaultWriteObject.

handleForClassback to summary
private static MethodHandle handleForClass(final MethodHandle handle, final Class<?> clazz, final Class<?> ioClass)