org.jboss.marshalling.serial
Class SerialUnmarshaller

java.lang.Object
  extended by org.jboss.marshalling.AbstractUnmarshaller
      extended by org.jboss.marshalling.serial.SerialUnmarshaller
All Implemented Interfaces:
java.io.Closeable, java.io.DataInput, java.io.ObjectInput, java.io.ObjectStreamConstants, ByteInput, ExtendedObjectStreamConstants, Unmarshaller

public final class SerialUnmarshaller
extends AbstractUnmarshaller
implements Unmarshaller, ExtendedObjectStreamConstants


Field Summary
 
Fields inherited from class org.jboss.marshalling.AbstractUnmarshaller
byteInput, classExternalizerFactory, classResolver, classTable, configuredVersion, creator, externalizerFactory, objectResolver, objectTable, streamHeader
 
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, 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
 
Method Summary
 void clearClassCache()
          Discard the class cache.
 void clearInstanceCache()
          Discard the instance cache.
 void close()
           
 org.jboss.marshalling.serial.Descriptor descriptorForClass(java.lang.Class<?> clazz)
           
protected  java.lang.Object doReadObject(boolean unshared)
          Implementation of the actual object-reading method.
protected  void doStart()
          Perform any unmarshaller-specific start activity.
 void finish()
          Finish unmarshalling from a stream.
 void start(ByteInput byteInput)
          Begin unmarshalling from a stream.
 
Methods inherited from class org.jboss.marshalling.AbstractUnmarshaller
available, read, read, read, readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readIntDirect, readLine, readLong, readLongDirect, readObject, readObjectUnshared, readShort, readUnsignedByte, readUnsignedByteDirect, readUnsignedShort, readUTF, skip, skipBytes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jboss.marshalling.Unmarshaller
readObjectUnshared
 
Methods inherited from interface java.io.ObjectInput
available, read, read, read, readObject, skip
 
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 org.jboss.marshalling.ByteInput
available, read, read, read, skip
 

Method Detail

doReadObject

protected java.lang.Object doReadObject(boolean unshared)
                                 throws java.lang.ClassNotFoundException,
                                        java.io.IOException
Description copied from class: AbstractUnmarshaller
Implementation of the actual object-reading method.

Specified by:
doReadObject in class AbstractUnmarshaller
Parameters:
unshared - true if the instance should be unshared, false if it is shared
Returns:
the object to read
Throws:
java.lang.ClassNotFoundException - if the class for the object could not be loaded
java.io.IOException - if an I/O error occurs

clearInstanceCache

public void clearInstanceCache()
                        throws java.io.IOException
Description copied from interface: Unmarshaller
Discard the instance cache.

Specified by:
clearInstanceCache in interface Unmarshaller
Throws:
java.io.IOException - if an error occurs

clearClassCache

public void clearClassCache()
                     throws java.io.IOException
Description copied from interface: Unmarshaller
Discard the class cache. Implicitly also discards the instance cache.

Specified by:
clearClassCache in interface Unmarshaller
Throws:
java.io.IOException - if an error occurs

start

public void start(ByteInput byteInput)
           throws java.io.IOException
Description copied from class: AbstractUnmarshaller
Begin unmarshalling from a stream.

Specified by:
start in interface Unmarshaller
Overrides:
start in class AbstractUnmarshaller
Parameters:
byteInput - the new stream
Throws:
java.io.IOException - if an error occurs during setup, such as an invalid header

doStart

protected void doStart()
                throws java.io.IOException
Description copied from class: AbstractUnmarshaller
Perform any unmarshaller-specific start activity. This implementation simply reads the stream header.

Overrides:
doStart in class AbstractUnmarshaller
Throws:
java.io.IOException - if I/O exception occurs

finish

public void finish()
            throws java.io.IOException
Description copied from class: AbstractUnmarshaller
Finish unmarshalling from a stream. Any transient class or instance cache is discarded.

Specified by:
finish in interface Unmarshaller
Overrides:
finish in class AbstractUnmarshaller
Throws:
java.io.IOException - if an error occurs

close

public void close()
           throws java.io.IOException
Specified by:
close in interface java.io.Closeable
Specified by:
close in interface java.io.ObjectInput
Throws:
java.io.IOException

descriptorForClass

public org.jboss.marshalling.serial.Descriptor descriptorForClass(java.lang.Class<?> clazz)