Package org.jboss.marshalling
Interface Unmarshaller
- All Superinterfaces:
AutoCloseable
,ByteInput
,Closeable
,DataInput
,ObjectInput
- All Known Implementing Classes:
AbstractUnmarshaller
,BlockUnmarshaller
,BlockUnmarshaller
,ObjectInputStreamUnmarshaller
,RiverUnmarshaller
,SerializingCloner.StepObjectInput
,SerialUnmarshaller
An unmarshaller which reads objects from a stream.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Discard the class cache.void
Discard the instance cache.void
finish()
Finish unmarshalling from a stream.<T> T
readObject
(Class<T> type) Read and return an object, cast to a specific type.Read and return an unshared object.<T> T
readObjectUnshared
(Class<T> type) Read and return an unshared object, cast to a specific type.void
Begin unmarshalling from a stream.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, close, read, read, read, readObject, skip
-
Method Details
-
readObject
Read and return an object, cast to a specific type.- Type Parameters:
T
- the object type- Parameters:
type
- the object class- Returns:
- the object read from the stream
- Throws:
ClassNotFoundException
- if the class of a serialized object cannot be foundInvalidObjectException
- if the object is not of the expected typeIOException
- if an error occurs
-
start
Begin unmarshalling from a stream.- Parameters:
newInput
- the new stream- Throws:
IOException
- if an error occurs during setup, such as an invalid header
-
clearInstanceCache
Discard the instance cache.- Throws:
IOException
- if an error occurs
-
clearClassCache
Discard the class cache. Implicitly also discards the instance cache.- Throws:
IOException
- if an error occurs
-
finish
Finish unmarshalling from a stream. Any transient class or instance cache is discarded.- Throws:
IOException
- if an error occurs