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