Top Fields Constructors Methods
io.netty.handler.codec.serialization

pack-priv Class CompactObjectInputStream

extends ObjectInputStream
Class Inheritance
Imports
java.io.EOFException, .IOException, .InputStream, .ObjectInputStream, .ObjectStreamClass, .StreamCorruptedException

Field Summary

Modifier and TypeField and Description
private final ClassResolver
classResolver

Deprecated as a consequence of ClassResolver being deprecated.

Constructor Summary

AccessConstructor and Description
pack-priv
CompactObjectInputStream(InputStream in, ClassResolver classResolver)

Deprecated as a consequence of ClassResolver being deprecated.

Method Summary

Modifier and TypeMethod and Description
protected ObjectStreamClass
readClassDescriptor()

Overrides java.io.ObjectInputStream.readClassDescriptor.

Read a class descriptor from the serialization stream.
protected void
readStreamHeader()

Overrides java.io.ObjectInputStream.readStreamHeader.

The readStreamHeader method is provided to allow subclasses to read and verify their own stream headers.
protected Class<?>
resolveClass(ObjectStreamClass
an instance of class ObjectStreamClass
desc
)

Overrides java.io.ObjectInputStream.resolveClass.

Load the local class equivalent of the specified stream class description.
Inherited from java.io.ObjectInputStream:
availableclosedefaultReadObjectenableResolveObjectgetObjectInputFilterreadreadreadBooleanreadBytereadCharreadDoublereadFieldsreadFloatreadFullyreadFullyreadIntreadLinereadLongreadObjectreadObjectOverridereadShortreadUnsharedreadUnsignedBytereadUnsignedShortreadUTFregisterValidationresolveObjectresolveProxyClasssetObjectInputFilterskipBytes

Field Detail

classResolverback to summary
private final ClassResolver classResolver

Deprecated

as a consequence of ClassResolver being deprecated. See corresponding docs for further information.

Constructor Detail

CompactObjectInputStreamback to summary
pack-priv CompactObjectInputStream(InputStream in, ClassResolver classResolver) throws IOException

Deprecated

as a consequence of ClassResolver being deprecated. See corresponding docs for further information.

Method Detail

readClassDescriptorback to summary
protected ObjectStreamClass readClassDescriptor() throws IOException, ClassNotFoundException

Overrides java.io.ObjectInputStream.readClassDescriptor.

Doc from java.io.ObjectInputStream.readClassDescriptor.

Read a class descriptor from the serialization stream. This method is called when the ObjectInputStream expects a class descriptor as the next item in the serialization stream. Subclasses of ObjectInputStream may override this method to read in class descriptors that have been written in non-standard formats (by subclasses of ObjectOutputStream which have overridden the writeClassDescriptor method). By default, this method reads class descriptors according to the format defined in the Object Serialization specification.

Returns:ObjectStreamClass

the class descriptor read

Annotations
@Override
Exceptions
IOException:
If an I/O error has occurred.
ClassNotFoundException:
If the Class of a serialized object used in the class descriptor representation cannot be found
readStreamHeaderback to summary
protected void readStreamHeader() throws IOException

Overrides java.io.ObjectInputStream.readStreamHeader.

Doc from java.io.ObjectInputStream.readStreamHeader.

The readStreamHeader method is provided to allow subclasses to read and verify their own stream headers. It reads and verifies the magic number and version number.

Annotations
@Override
Exceptions
IOException:
if there are I/O errors while reading from the underlying InputStream
resolveClassback to summary
protected Class<?> resolveClass(ObjectStreamClass desc) throws IOException, ClassNotFoundException

Overrides java.io.ObjectInputStream.resolveClass.

Doc from java.io.ObjectInputStream.resolveClass.

Load the local class equivalent of the specified stream class description. Subclasses may implement this method to allow classes to be fetched from an alternate source.

The corresponding method in ObjectOutputStream is annotateClass. This method will be invoked only once for each unique class in the stream. This method can be implemented by subclasses to use an alternate loading mechanism but must return a Class object. Once returned, if the class is not an array class, its serialVersionUID is compared to the serialVersionUID of the serialized class, and if there is a mismatch, the deserialization fails and an InvalidClassException is thrown.

The default implementation of this method in ObjectInputStream returns the result of calling

Class.forName(desc.getName(), false, loader)
Class.forName(desc.getName(), false, loader)
where loader is the first class loader on the current thread's stack (starting from the currently executing method) that is neither the platform class loader nor its ancestor; otherwise, loader is the platform class loader. If this call results in a ClassNotFoundException and the name of the passed ObjectStreamClass instance is the Java language keyword for a primitive type or void, then the Class object representing that primitive type or void will be returned (e.g., an ObjectStreamClass with the name "int" will be resolved to Integer.TYPE). Otherwise, the ClassNotFoundException will be thrown to the caller of this method.
Parameters
desc:ObjectStreamClass

an instance of class ObjectStreamClass

Returns:Class<?>

a Class object corresponding to desc

Annotations
@Override
Exceptions
IOException:
any of the usual Input/Output exceptions.
ClassNotFoundException:
if class of a serialized object cannot be found.