JBoss Marshalling 1.3.0.CR9

org.jboss.marshalling
Class AbstractObjectInput

java.lang.Object
  extended by java.io.InputStream
      extended by org.jboss.marshalling.SimpleByteInput
          extended by org.jboss.marshalling.ByteInputStream
              extended by org.jboss.marshalling.SimpleDataInput
                  extended by org.jboss.marshalling.AbstractObjectInput
All Implemented Interfaces:
Closeable, DataInput, ObjectInput, ByteInput
Direct Known Subclasses:
AbstractUnmarshaller

public abstract class AbstractObjectInput
extends SimpleDataInput
implements ObjectInput


Field Summary
 
Fields inherited from class org.jboss.marshalling.SimpleDataInput
buffer, limit, position
 
Fields inherited from class org.jboss.marshalling.ByteInputStream
byteInput
 
Constructor Summary
protected AbstractObjectInput(int bufferSize)
           
 
Method Summary
protected abstract  Object doReadObject(boolean unshared)
          Implementation of the actual object-reading method.
 Object readObject()
          
<T> T
readObject(Class<T> type)
          Read and return an object, cast to a specific type.
 Object readObjectUnshared()
          Read and return an unshared object.
<T> T
readObjectUnshared(Class<T> type)
          Read and return an unshared object, cast to a specific type.
 
Methods inherited from class org.jboss.marshalling.SimpleDataInput
available, close, finish, read, read, read, readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readIntDirect, readLine, readLong, readLongDirect, readShort, readUnsignedByte, readUnsignedByteDirect, readUnsignedShort, readUTF, skip, skipBytes, start
 
Methods inherited from class java.io.InputStream
mark, markSupported, reset
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.io.ObjectInput
available, close, read, read, read, skip
 
Methods inherited from interface java.io.DataInput
readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, skipBytes
 

Constructor Detail

AbstractObjectInput

protected AbstractObjectInput(int bufferSize)
Method Detail

readObject

public final Object readObject()
                        throws ClassNotFoundException,
                               IOException

Specified by:
readObject in interface ObjectInput
Throws:
ClassNotFoundException
IOException

readObjectUnshared

public final Object readObjectUnshared()
                                throws ClassNotFoundException,
                                       IOException
Read and return an unshared object.

Returns:
an unshared object
Throws:
ClassNotFoundException - if the class of a serialized object cannot be found
IOException - if an error occurs

doReadObject

protected abstract Object doReadObject(boolean unshared)
                                throws ClassNotFoundException,
                                       IOException
Implementation of the actual object-reading method.

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 loaded
IOException - if an I/O error occurs

readObject

public <T> T readObject(Class<T> type)
             throws ClassNotFoundException,
                    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:
ClassNotFoundException - if the class of a serialized object cannot be found
InvalidObjectException - if the object is not of the expected type
IOException - if an error occurs

readObjectUnshared

public <T> T readObjectUnshared(Class<T> type)
                     throws ClassNotFoundException,
                            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:
ClassNotFoundException - if the class of a serialized object cannot be found
InvalidObjectException - if the object is not of the expected type
IOException - if an error occurs

JBoss Marshalling 1.3.0.CR9

Copyright © 2011 JBoss, a division of Red Hat, Inc.