Class SerialUnmarshaller
- All Implemented Interfaces:
Closeable, DataInput, ObjectInput, ObjectStreamConstants, AutoCloseable, ByteInput, ExtendedObjectStreamConstants, Unmarshaller
public final class SerialUnmarshaller
extends AbstractUnmarshaller
implements Unmarshaller, ExtendedObjectStreamConstants
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate BlockUnmarshallerprivate final PrivilegedExceptionAction<SerialObjectInputStream> private intprivate static final int[]private static final String[]private SerialObjectInputStreamprivate final SerializableClassRegistryprivate static final Objectprivate static final Objectprivate final SortedMap<Integer, Set<ObjectInputValidation>> private intFields inherited from class AbstractUnmarshaller
classExternalizerFactory, classResolver, classTable, configuredVersion, exceptionListener, objectPreResolver, objectResolver, objectTable, serializabilityChecker, streamHeaderFields inherited from class SimpleDataInput
buffer, limit, positionFields inherited from class ByteInputStream
byteInputFields inherited from interface ExtendedObjectStreamConstants
TC_CLASSTABLEDESC, TC_OBJECTTABLEFields inherited from interface ObjectStreamConstants
baseWireHandle, PROTOCOL_VERSION_1, PROTOCOL_VERSION_2, SC_BLOCK_DATA, SC_ENUM, SC_EXTERNALIZABLE, SC_SERIALIZABLE, SC_WRITE_METHOD, SERIAL_FILTER_PERMISSION, STREAM_MAGIC, STREAM_VERSION, SUBCLASS_IMPLEMENTATION_PERMISSION, SUBSTITUTION_PERMISSION, TC_ARRAY, TC_BASE, TC_BLOCKDATA, TC_BLOCKDATALONG, TC_CLASS, TC_CLASSDESC, TC_ENDBLOCKDATA, TC_ENUM, TC_EXCEPTION, TC_LONGSTRING, TC_MAX, TC_NULL, TC_OBJECT, TC_PROXYCLASSDESC, TC_REFERENCE, TC_RESET, TC_STRING -
Constructor Summary
ConstructorsConstructorDescriptionSerialUnmarshaller(SerialMarshallerFactory factory, SerializableClassRegistry registry, MarshallingConfiguration configuration) -
Method Summary
Modifier and TypeMethodDescription(package private) voidaddValidation(ObjectInputValidation validation, int prio) private StreamCorruptedExceptionbadLeadByte(int leadByte) private Descriptorbridge(Descriptor descriptor, Class<?> type) voidDiscard the class cache.voidDiscard the instance cache.voidclose()private SerialObjectInputStreamdescriptorForClass(Class<?> clazz) protected ObjectdoReadObject(boolean unshared) Implementation of the actual object-reading method.(package private) ObjectdoReadObject(int leadByte, boolean unshared) private voiddoReadSerialObject(Descriptor descriptor, Object obj) (package private) Stringvoidfinish()Finish reading from the current input.(package private) BlockUnmarshaller(package private) SerialObjectInputStreamprivate static InvalidClassException(package private) ObjectreadBackReference(int handle) private DescriptorreadClassDescriptor(boolean required) private DescriptorreadClassDescriptor(int leadByte, boolean required) private Descriptorprivate ObjectreplaceOrReturn(boolean unshared, Object object) private ObjectreplaceOrReturn(boolean unshared, Object object, int idx) voidStart reading from the given input.Methods inherited from class AbstractObjectInput
readObject, readObject, readObjectUnshared, readObjectUnsharedMethods inherited from class SimpleDataInput
available, read, read, read, readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readIntDirect, readLine, readLong, readLongDirect, readShort, readUnsignedByte, readUnsignedByteDirect, readUnsignedShort, readUTF, skip, skipBytesMethods inherited from class InputStream
mark, markSupported, nullInputStream, readAllBytes, readNBytes, readNBytes, reset, skipNBytes, transferToMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface DataInput
readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, skipBytesMethods inherited from interface ObjectInput
available, read, read, read, readObject, skipMethods inherited from interface Unmarshaller
readObject, readObjectUnshared, readObjectUnshared
-
Field Details
-
UNSHARED
-
UNRESOLVED
-
instanceCache
-
registry
-
depth
private int depth -
ois
-
blockUnmarshaller
-
version
private int version -
EMPTY_INTS
private static final int[] EMPTY_INTS -
EMPTY_STRINGS
-
createObjectOutputStreamAction
-
validationMap
-
-
Constructor Details
-
SerialUnmarshaller
SerialUnmarshaller(SerialMarshallerFactory factory, SerializableClassRegistry registry, MarshallingConfiguration configuration)
-
-
Method Details
-
doReadObject
Description copied from class:AbstractObjectInputImplementation of the actual object-reading method.- Specified by:
doReadObjectin classAbstractObjectInput- Parameters:
unshared-trueif the instance should be unshared,falseif it is shared- Returns:
- the object to read
- Throws:
ClassNotFoundException- if the class for the object could not be loadedIOException- if an I/O error occurs
-
doReadString
- Throws:
IOExceptionClassNotFoundException
-
readBackReference
- Throws:
IOException
-
doReadObject
- Throws:
IOExceptionClassNotFoundException
-
doReadSerialObject
private void doReadSerialObject(Descriptor descriptor, Object obj) throws ClassNotFoundException, IOException - Throws:
ClassNotFoundExceptionIOException
-
objectStreamClassException
-
readNonNullClassDescriptor
- Throws:
ClassNotFoundExceptionIOException
-
readClassDescriptor
- Throws:
ClassNotFoundExceptionIOException
-
readClassDescriptor
private Descriptor readClassDescriptor(int leadByte, boolean required) throws IOException, ClassNotFoundException - Throws:
IOExceptionClassNotFoundException
-
bridge
-
badLeadByte
-
clearInstanceCache
Description copied from interface:UnmarshallerDiscard the instance cache.- Specified by:
clearInstanceCachein interfaceUnmarshaller- Throws:
IOException- if an error occurs
-
clearClassCache
Description copied from interface:UnmarshallerDiscard the class cache. Implicitly also discards the instance cache.- Specified by:
clearClassCachein interfaceUnmarshaller- Throws:
IOException- if an error occurs
-
start
Description copied from class:AbstractUnmarshallerStart reading from the given input. The internal buffer is discarded.- Specified by:
startin interfaceUnmarshaller- Overrides:
startin classAbstractUnmarshaller- Parameters:
byteInput- the new input from which to read- Throws:
IOException- not thrown by this implementation, but may be overridden to be thrown if a problem occurs
-
finish
Description copied from class:AbstractUnmarshallerFinish reading from the current input. The internal buffer is discarded, not flushed.- Specified by:
finishin interfaceUnmarshaller- Overrides:
finishin classAbstractUnmarshaller- Throws:
IOException- not thrown by this implementation, but may be overridden to be thrown if a problem occurs
-
close
Description copied from class:SimpleDataInput- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceObjectInput- Overrides:
closein classSimpleDataInput- Throws:
IOException
-
getBlockUnmarshaller
BlockUnmarshaller getBlockUnmarshaller() -
createObjectInputStream
- Throws:
IOException
-
getObjectInputStream
- Throws:
IOException
-
addValidation
-
descriptorForClass
-
replaceOrReturn
-
replaceOrReturn
-