Package org.jboss.marshalling.serial
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 BlockUnmarshaller
private final PrivilegedExceptionAction
<SerialObjectInputStream> private int
private static final int[]
private static final String[]
private SerialObjectInputStream
private final SerializableClassRegistry
private static final Object
private static final Object
private final SortedMap
<Integer, Set<ObjectInputValidation>> private int
Fields inherited from class org.jboss.marshalling.AbstractUnmarshaller
classExternalizerFactory, classResolver, classTable, configuredVersion, exceptionListener, objectPreResolver, objectResolver, objectTable, serializabilityChecker, streamHeader
Fields inherited from class org.jboss.marshalling.SimpleDataInput
buffer, limit, position
Fields inherited from class org.jboss.marshalling.ByteInputStream
byteInput
Fields inherited from interface org.jboss.marshalling.serial.ExtendedObjectStreamConstants
TC_CLASSTABLEDESC, TC_OBJECTTABLE
Fields inherited from interface java.io.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) void
addValidation
(ObjectInputValidation validation, int prio) private StreamCorruptedException
badLeadByte
(int leadByte) private Descriptor
bridge
(Descriptor descriptor, Class<?> type) void
Discard the class cache.void
Discard the instance cache.void
close()
private SerialObjectInputStream
descriptorForClass
(Class<?> clazz) protected Object
doReadObject
(boolean unshared) Implementation of the actual object-reading method.(package private) Object
doReadObject
(int leadByte, boolean unshared) private void
doReadSerialObject
(Descriptor descriptor, Object obj) (package private) String
void
finish()
Finish reading from the current input.(package private) BlockUnmarshaller
(package private) SerialObjectInputStream
private static InvalidClassException
(package private) Object
readBackReference
(int handle) private Descriptor
readClassDescriptor
(boolean required) private Descriptor
readClassDescriptor
(int leadByte, boolean required) private Descriptor
private Object
replaceOrReturn
(boolean unshared, Object object) private Object
replaceOrReturn
(boolean unshared, Object object, int idx) void
Start reading from the given input.Methods inherited from class org.jboss.marshalling.AbstractObjectInput
readObject, readObject, readObjectUnshared, readObjectUnshared
Methods inherited from class org.jboss.marshalling.SimpleDataInput
available, read, read, read, readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readIntDirect, readLine, readLong, readLongDirect, readShort, readUnsignedByte, readUnsignedByteDirect, readUnsignedShort, readUTF, skip, skipBytes
Methods inherited from class java.io.InputStream
mark, markSupported, nullInputStream, readAllBytes, readNBytes, readNBytes, reset, skipNBytes, transferTo
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.io.DataInput
readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, skipBytes
Methods inherited from interface java.io.ObjectInput
available, read, read, read, readObject, skip
Methods inherited from interface org.jboss.marshalling.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:AbstractObjectInput
Implementation of the actual object-reading method.- Specified by:
doReadObject
in classAbstractObjectInput
- Parameters:
unshared
-true
if the instance should be unshared,false
if 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:
IOException
ClassNotFoundException
-
readBackReference
- Throws:
IOException
-
doReadObject
- Throws:
IOException
ClassNotFoundException
-
doReadSerialObject
private void doReadSerialObject(Descriptor descriptor, Object obj) throws ClassNotFoundException, IOException - Throws:
ClassNotFoundException
IOException
-
objectStreamClassException
-
readNonNullClassDescriptor
- Throws:
ClassNotFoundException
IOException
-
readClassDescriptor
- Throws:
ClassNotFoundException
IOException
-
readClassDescriptor
private Descriptor readClassDescriptor(int leadByte, boolean required) throws IOException, ClassNotFoundException - Throws:
IOException
ClassNotFoundException
-
bridge
-
badLeadByte
-
clearInstanceCache
Description copied from interface:Unmarshaller
Discard the instance cache.- Specified by:
clearInstanceCache
in interfaceUnmarshaller
- Throws:
IOException
- if an error occurs
-
clearClassCache
Description copied from interface:Unmarshaller
Discard the class cache. Implicitly also discards the instance cache.- Specified by:
clearClassCache
in interfaceUnmarshaller
- Throws:
IOException
- if an error occurs
-
start
Description copied from class:AbstractUnmarshaller
Start reading from the given input. The internal buffer is discarded.- Specified by:
start
in interfaceUnmarshaller
- Overrides:
start
in 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:AbstractUnmarshaller
Finish reading from the current input. The internal buffer is discarded, not flushed.- Specified by:
finish
in interfaceUnmarshaller
- Overrides:
finish
in 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:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceObjectInput
- Overrides:
close
in classSimpleDataInput
- Throws:
IOException
-
getBlockUnmarshaller
BlockUnmarshaller getBlockUnmarshaller() -
createObjectInputStream
- Throws:
IOException
-
getObjectInputStream
- Throws:
IOException
-
addValidation
-
descriptorForClass
-
replaceOrReturn
-
replaceOrReturn
-