Top Fields Constructors Methods
org.jboss.marshalling.river

pack-priv Class RiverObjectInputStream

extends MarshallerObjectInputStream
Class Inheritance
Imports
org.jboss.marshalling.MarshallerObjectInputStream, .TraceInformation, org.jboss.marshalling.util.ReadField, .ShortReadField, .ObjectReadField, .LongReadField, .IntReadField, .FloatReadField, .DoubleReadField, .CharReadField, .ByteReadField, .BooleanReadField, org.jboss.marshalling.reflect.SerializableField, java.io.IOException, .ObjectInputValidation, .NotActiveException, .InvalidObjectException, .ObjectStreamClass

Field Summary

Modifier and TypeField and Description
private final BlockUnmarshaller
private Object
private static final int
private static final int
private int
private SerializableClassDescriptor
private int
private final RiverUnmarshaller
private static final int
private static final int

Constructor Summary

AccessConstructor and Description
protected
RiverObjectInputStream(final RiverUnmarshaller riverUnmarshaller, final BlockUnmarshaller delegateUnmarshaller)

Method Summary

Modifier and TypeMethod and Description
private void
public void
defaultReadObject()

Implements abstract org.jboss.marshalling.MarshallerObjectInputStream.defaultReadObject.

Read the non-static and non-transient fields of the current class from this stream.
pack-priv void
protected void
finish(final int restoreState)

protected void
private int
getAndSet(int set)

protected int
protected void
public int
read()

Overrides org.jboss.marshalling.MarshallerObjectInputStream.read.

Implements org.jboss.marshalling.ByteInput.read, java.io.ObjectInput.read.

Reads the next byte of data from the input stream.
public int
read(final byte[]
the destination array
buf
)

Overrides org.jboss.marshalling.MarshallerObjectInputStream.read.

Implements org.jboss.marshalling.ByteInput.read, java.io.ObjectInput.read.

Read some bytes from the input stream into the given array.
public int
read(final byte[]
the destination array
buf
,
final int
the offset into the array into which data should be read
off
,
final int
the number of bytes to attempt to fill in the destination array
len
)

Overrides org.jboss.marshalling.MarshallerObjectInputStream.read.

Implements org.jboss.marshalling.ByteInput.read, java.io.ObjectInput.read.

Read some bytes from the input stream into the given array.
public boolean
public byte
public char
public double
public ObjectInputStream.GetField
readFields()

Implements abstract org.jboss.marshalling.MarshallerObjectInputStream.readFields.

Reads the persistent fields from the stream and makes them available by name.
public float
public void
readFully(final byte[]
the buffer into which the data is read
buf
)

Overrides org.jboss.marshalling.MarshallerObjectInputStream.readFully.

Implements java.io.DataInput.readFully.

Reads bytes, blocking until all bytes are read.
public void
readFully(final byte[]
the buffer into which the data is read
buf
,
final int
the start offset into the data array buf
off
,
final int
the maximum number of bytes to read
len
)

Overrides org.jboss.marshalling.MarshallerObjectInputStream.readFully.

Implements java.io.DataInput.readFully.

Reads bytes, blocking until all bytes are read.
public int
public String
readLine()

Overrides org.jboss.marshalling.MarshallerObjectInputStream.readLine.

Implements java.io.DataInput.readLine.

Deprecated
Reads in a line that has been terminated by a \n, \r, \r\n or EOF.
public long
protected Object
readObjectOverride()

Overrides org.jboss.marshalling.MarshallerObjectInputStream.readObjectOverride.

This method is called by trusted subclasses of ObjectInputStream that constructed ObjectInputStream using the protected no-arg constructor.
public short
public Object
readUnshared()

Overrides org.jboss.marshalling.MarshallerObjectInputStream.readUnshared.

Reads an "unshared" object from the ObjectInputStream.
public int
public int
public String
public void
registerValidation(final ObjectInputValidation
the object to receive the validation callback.
obj
,
final int
controls the order of callbacks; zero is a good default. Use higher numbers to be called back earlier, lower numbers for later callbacks. Within a priority, callbacks are processed in no particular order.
prio
)

Implements abstract org.jboss.marshalling.MarshallerObjectInputStream.registerValidation.

Register an object to be validated before the graph is returned.
public long
skip(final long
the number of bytes to attempt to skip
n
)

Overrides org.jboss.marshalling.MarshallerObjectInputStream.skip.

Implements org.jboss.marshalling.ByteInput.skip, java.io.ObjectInput.skip.

Skips over and discards up to n bytes of data from this input stream.
public int
skipBytes(final int
the number of bytes to be skipped
len
)

Overrides org.jboss.marshalling.MarshallerObjectInputStream.skipBytes.

Implements java.io.DataInput.skipBytes.

Skips bytes.
protected int
protected SerializableClassDescriptor
protected Object
swapCurrent(final Object obj)

Inherited from org.jboss.marshalling.MarshallerObjectInputStream:
availablecloseenableResolveObjectmarkmarkSupportedreadClassDescriptorreadStreamHeaderresetresolveClassresolveObjectresolveProxyClass

Field Detail

blockUnmarshallerback to summary
private final BlockUnmarshaller blockUnmarshaller
currentback to summary
private Object current
OFFback to summary
private static final int OFF
ONback to summary
private static final int ON
restoreIdxback to summary
private int restoreIdx
serializableClassDescriptorback to summary
private SerializableClassDescriptor serializableClassDescriptor
stateback to summary
private int state
unmarshallerback to summary
private final RiverUnmarshaller unmarshaller
UNREAD_FIELDSback to summary
private static final int UNREAD_FIELDS
UNREAD_FIELDS_EOBback to summary
private static final int UNREAD_FIELDS_EOB

Constructor Detail

RiverObjectInputStreamback to summary
protected RiverObjectInputStream(final RiverUnmarshaller riverUnmarshaller, final BlockUnmarshaller delegateUnmarshaller) throws IOException, SecurityException

Method Detail

checkStateback to summary
private void checkState() throws IOException
defaultReadObjectback to summary
public void defaultReadObject() throws IOException, ClassNotFoundException

Implements abstract org.jboss.marshalling.MarshallerObjectInputStream.defaultReadObject.

Doc from org.jboss.marshalling.MarshallerObjectInputStream.defaultReadObject.

Read the non-static and non-transient fields of the current class from this stream. This may only be called from the readObject method of the class being deserialized. It will throw the NotActiveException if it is called otherwise.

Exceptions
IOException:

Doc from java.io.ObjectInputStream.defaultReadObject.

if an I/O error occurs.

ClassNotFoundException:

Doc from java.io.ObjectInputStream.defaultReadObject.

if the class of a serialized object could not be found.

discardReadObjectback to summary
pack-priv void discardReadObject() throws IOException
finishback to summary
protected void finish(final int restoreState) throws IOException
fullResetback to summary
protected void fullReset()
getAndSetback to summary
private int getAndSet(int set)
getRestoreIdxback to summary
protected int getRestoreIdx()
noCustomDataback to summary
protected void noCustomData()
readback to summary
public int read() throws IOException

Overrides org.jboss.marshalling.MarshallerObjectInputStream.read.

Implements org.jboss.marshalling.ByteInput.read, java.io.ObjectInput.read.

Doc from org.jboss.marshalling.MarshallerObjectInputStream.read.

Reads the next byte of data from the input stream. If no byte is available because the end of the stream has been reached, the value -1 is returned. This method blocks until input data is available, the end of the stream is detected, or an exception is thrown.

Returns:int

Doc from org.jboss.marshalling.ByteInput.read.

the next byte, or -1 if the end of stream has been reached

Exceptions
IOException:

Doc from org.jboss.marshalling.ByteInput.read.

if an error occurs

readback to summary
public int read(final byte[] buf) throws IOException

Overrides org.jboss.marshalling.MarshallerObjectInputStream.read.

Implements org.jboss.marshalling.ByteInput.read, java.io.ObjectInput.read.

Doc from org.jboss.marshalling.MarshallerObjectInputStream.read.

Read some bytes from the input stream into the given array. Returns the number of bytes actually read (possibly zero), or -1 if the end of stream has been reached.

Parameters
buf:byte[]

Doc from org.jboss.marshalling.ByteInput.read.

the destination array

Returns:int

Doc from org.jboss.marshalling.ByteInput.read.

the number of bytes read (possibly zero), or -1 if the end of stream has been reached

Exceptions
IOException:

Doc from org.jboss.marshalling.ByteInput.read.

if an error occurs

readback to summary
public int read(final byte[] buf, final int off, final int len) throws IOException

Overrides org.jboss.marshalling.MarshallerObjectInputStream.read.

Implements org.jboss.marshalling.ByteInput.read, java.io.ObjectInput.read.

Doc from org.jboss.marshalling.MarshallerObjectInputStream.read.

Read some bytes from the input stream into the given array. Returns the number of bytes actually read (possibly zero), or -1 if the end of stream has been reached.

Parameters
buf:byte[]

Doc from org.jboss.marshalling.ByteInput.read.

the destination array

off:int

Doc from org.jboss.marshalling.ByteInput.read.

the offset into the array into which data should be read

len:int

Doc from org.jboss.marshalling.ByteInput.read.

the number of bytes to attempt to fill in the destination array

Returns:int

Doc from org.jboss.marshalling.ByteInput.read.

the number of bytes read (possibly zero), or -1 if the end of stream has been reached

Exceptions
IOException:

Doc from org.jboss.marshalling.ByteInput.read.

if an error occurs

readBooleanback to summary
public boolean readBoolean() throws IOException

Overrides org.jboss.marshalling.MarshallerObjectInputStream.readBoolean.

Implements java.io.DataInput.readBoolean.

Doc from org.jboss.marshalling.MarshallerObjectInputStream.readBoolean.

Reads in a boolean.

Returns:boolean

Doc from java.io.ObjectInputStream.readBoolean.

the boolean read.

Exceptions
IOException:

Doc from java.io.ObjectInputStream.readBoolean.

If other I/O error has occurred.

readByteback to summary
public byte readByte() throws IOException

Overrides org.jboss.marshalling.MarshallerObjectInputStream.readByte.

Implements java.io.DataInput.readByte.

Doc from org.jboss.marshalling.MarshallerObjectInputStream.readByte.

Reads an 8-bit byte.

Returns:byte

Doc from java.io.ObjectInputStream.readByte.

the 8-bit byte read.

Exceptions
IOException:

Doc from java.io.ObjectInputStream.readByte.

If other I/O error has occurred.

readCharback to summary
public char readChar() throws IOException

Overrides org.jboss.marshalling.MarshallerObjectInputStream.readChar.

Implements java.io.DataInput.readChar.

Doc from org.jboss.marshalling.MarshallerObjectInputStream.readChar.

Reads a 16-bit char.

Returns:char

Doc from java.io.ObjectInputStream.readChar.

the 16-bit char read.

Exceptions
IOException:

Doc from java.io.ObjectInputStream.readChar.

If other I/O error has occurred.

readDoubleback to summary
public double readDouble() throws IOException

Overrides org.jboss.marshalling.MarshallerObjectInputStream.readDouble.

Implements java.io.DataInput.readDouble.

Doc from org.jboss.marshalling.MarshallerObjectInputStream.readDouble.

Reads a 64-bit double.

Returns:double

Doc from java.io.ObjectInputStream.readDouble.

the 64-bit double read.

Exceptions
IOException:

Doc from java.io.ObjectInputStream.readDouble.

If other I/O error has occurred.

readFieldsback to summary
public ObjectInputStream.GetField readFields() throws IOException, ClassNotFoundException

Implements abstract org.jboss.marshalling.MarshallerObjectInputStream.readFields.

Doc from org.jboss.marshalling.MarshallerObjectInputStream.readFields.

Reads the persistent fields from the stream and makes them available by name.

Returns:ObjectInputStream.GetField

Doc from java.io.ObjectInputStream.readFields.

the GetField object representing the persistent fields of the object being deserialized

Exceptions
IOException:

Doc from java.io.ObjectInputStream.readFields.

if an I/O error occurs.

ClassNotFoundException:

Doc from java.io.ObjectInputStream.readFields.

if the class of a serialized object could not be found.

readFloatback to summary
public float readFloat() throws IOException

Overrides org.jboss.marshalling.MarshallerObjectInputStream.readFloat.

Implements java.io.DataInput.readFloat.

Doc from org.jboss.marshalling.MarshallerObjectInputStream.readFloat.

Reads a 32-bit float.

Returns:float

Doc from java.io.ObjectInputStream.readFloat.

the 32-bit float read.

Exceptions
IOException:

Doc from java.io.ObjectInputStream.readFloat.

If other I/O error has occurred.

readFullyback to summary
public void readFully(final byte[] buf) throws IOException

Overrides org.jboss.marshalling.MarshallerObjectInputStream.readFully.

Implements java.io.DataInput.readFully.

Doc from org.jboss.marshalling.MarshallerObjectInputStream.readFully.

Reads bytes, blocking until all bytes are read.

Parameters
buf:byte[]

Doc from java.io.ObjectInputStream.readFully.

the buffer into which the data is read

Exceptions
IOException:

Doc from java.io.ObjectInputStream.readFully.

If other I/O error has occurred.

readFullyback to summary
public void readFully(final byte[] buf, final int off, final int len) throws IOException

Overrides org.jboss.marshalling.MarshallerObjectInputStream.readFully.

Implements java.io.DataInput.readFully.

Doc from org.jboss.marshalling.MarshallerObjectInputStream.readFully.

Reads bytes, blocking until all bytes are read.

Parameters
buf:byte[]

Doc from java.io.ObjectInputStream.readFully.

the buffer into which the data is read

off:int

Doc from java.io.ObjectInputStream.readFully.

the start offset into the data array buf

len:int

Doc from java.io.ObjectInputStream.readFully.

the maximum number of bytes to read

Exceptions
IOException:

Doc from java.io.ObjectInputStream.readFully.

If other I/O error has occurred.

readIntback to summary
public int readInt() throws IOException

Overrides org.jboss.marshalling.MarshallerObjectInputStream.readInt.

Implements java.io.DataInput.readInt.

Doc from org.jboss.marshalling.MarshallerObjectInputStream.readInt.

Reads a 32-bit int.

Returns:int

Doc from java.io.ObjectInputStream.readInt.

the 32-bit integer read.

Exceptions
IOException:

Doc from java.io.ObjectInputStream.readInt.

If other I/O error has occurred.

readLineback to summary
public String readLine() throws IOException

Overrides org.jboss.marshalling.MarshallerObjectInputStream.readLine.

Implements java.io.DataInput.readLine.

Doc from org.jboss.marshalling.MarshallerObjectInputStream.readLine.

Deprecated

Reads in a line that has been terminated by a \n, \r, \r\n or EOF.

Returns:String

Doc from java.io.ObjectInputStream.readLine.

a String copy of the line.

Annotations
@Deprecated
@SuppressWarnings:deprecation
Exceptions
IOException:

Doc from java.io.ObjectInputStream.readLine.

if there are I/O errors while reading from the underlying InputStream

readLongback to summary
public long readLong() throws IOException

Overrides org.jboss.marshalling.MarshallerObjectInputStream.readLong.

Implements java.io.DataInput.readLong.

Doc from org.jboss.marshalling.MarshallerObjectInputStream.readLong.

Reads a 64-bit long.

Returns:long

Doc from java.io.ObjectInputStream.readLong.

the read 64-bit long.

Exceptions
IOException:

Doc from java.io.ObjectInputStream.readLong.

If other I/O error has occurred.

readObjectOverrideback to summary
protected Object readObjectOverride() throws IOException, ClassNotFoundException

Overrides org.jboss.marshalling.MarshallerObjectInputStream.readObjectOverride.

Doc from org.jboss.marshalling.MarshallerObjectInputStream.readObjectOverride.

This method is called by trusted subclasses of ObjectInputStream that constructed ObjectInputStream using the protected no-arg constructor. The subclass is expected to provide an override method with the modifier "final".

Returns:Object

Doc from java.io.ObjectInputStream.readObjectOverride.

the Object read from the stream.

Exceptions
IOException:

Doc from java.io.ObjectInputStream.readObjectOverride.

if I/O errors occurred while reading from the underlying stream

ClassNotFoundException:

Doc from java.io.ObjectInputStream.readObjectOverride.

Class definition of a serialized object cannot be found.

readShortback to summary
public short readShort() throws IOException

Overrides org.jboss.marshalling.MarshallerObjectInputStream.readShort.

Implements java.io.DataInput.readShort.

Doc from org.jboss.marshalling.MarshallerObjectInputStream.readShort.

Reads a 16-bit short.

Returns:short

Doc from java.io.ObjectInputStream.readShort.

the 16-bit short read.

Exceptions
IOException:

Doc from java.io.ObjectInputStream.readShort.

If other I/O error has occurred.

readUnsharedback to summary
public Object readUnshared() throws IOException, ClassNotFoundException

Overrides org.jboss.marshalling.MarshallerObjectInputStream.readUnshared.

Doc from org.jboss.marshalling.MarshallerObjectInputStream.readUnshared.

Reads an "unshared" object from the ObjectInputStream. This method is identical to readObject, except that it prevents subsequent calls to readObject and readUnshared from returning additional references to the deserialized instance obtained via this call. Specifically:

  • If readUnshared is called to deserialize a back-reference (the stream representation of an object which has been written previously to the stream), an ObjectStreamException will be thrown.
  • If readUnshared returns successfully, then any subsequent attempts to deserialize back-references to the stream handle deserialized by readUnshared will cause an ObjectStreamException to be thrown.
Deserializing an object via readUnshared invalidates the stream handle associated with the returned object. Note that this in itself does not always guarantee that the reference returned by readUnshared is unique; the deserialized object may define a readResolve method which returns an object visible to other parties, or readUnshared may return a Class object or enum constant obtainable elsewhere in the stream or through external means. If the deserialized object defines a readResolve method and the invocation of that method returns an array, then readUnshared returns a shallow clone of that array; this guarantees that the returned array object is unique and cannot be obtained a second time from an invocation of readObject or readUnshared on the ObjectInputStream, even if the underlying data stream has been manipulated.

The deserialization filter, when not null, is invoked for each object (regular or class) read to reconstruct the root object. See setObjectInputFilter for details.

ObjectInputStream subclasses which override this method can only be constructed in security contexts possessing the "enableSubclassImplementation" SerializablePermission; any attempt to instantiate such a subclass without this permission will cause a SecurityException to be thrown.

Returns:Object

Doc from java.io.ObjectInputStream.readUnshared.

reference to deserialized object

Exceptions
IOException:

Doc from java.io.ObjectInputStream.readUnshared.

if an I/O error occurs during deserialization

ClassNotFoundException:

Doc from java.io.ObjectInputStream.readUnshared.

if class of an object to deserialize cannot be found

readUnsignedByteback to summary
public int readUnsignedByte() throws IOException

Overrides org.jboss.marshalling.MarshallerObjectInputStream.readUnsignedByte.

Implements java.io.DataInput.readUnsignedByte.

Doc from org.jboss.marshalling.MarshallerObjectInputStream.readUnsignedByte.

Reads an unsigned 8-bit byte.

Returns:int

Doc from java.io.ObjectInputStream.readUnsignedByte.

the 8-bit byte read.

Exceptions
IOException:

Doc from java.io.ObjectInputStream.readUnsignedByte.

If other I/O error has occurred.

readUnsignedShortback to summary
public int readUnsignedShort() throws IOException

Overrides org.jboss.marshalling.MarshallerObjectInputStream.readUnsignedShort.

Implements java.io.DataInput.readUnsignedShort.

Doc from org.jboss.marshalling.MarshallerObjectInputStream.readUnsignedShort.

Reads an unsigned 16-bit short.

Returns:int

Doc from java.io.ObjectInputStream.readUnsignedShort.

the 16-bit short read.

Exceptions
IOException:

Doc from java.io.ObjectInputStream.readUnsignedShort.

If other I/O error has occurred.

readUTFback to summary
public String readUTF() throws IOException

Overrides org.jboss.marshalling.MarshallerObjectInputStream.readUTF.

Implements java.io.DataInput.readUTF.

Doc from org.jboss.marshalling.MarshallerObjectInputStream.readUTF.

Reads a String in modified UTF-8 format.

Returns:String

Doc from java.io.ObjectInputStream.readUTF.

the String.

Exceptions
IOException:

Doc from java.io.ObjectInputStream.readUTF.

if there are I/O errors while reading from the underlying InputStream

registerValidationback to summary
public void registerValidation(final ObjectInputValidation obj, final int prio) throws NotActiveException, InvalidObjectException

Implements abstract org.jboss.marshalling.MarshallerObjectInputStream.registerValidation.

Doc from org.jboss.marshalling.MarshallerObjectInputStream.registerValidation.

Register an object to be validated before the graph is returned. While similar to resolveObject these validations are called after the entire graph has been reconstituted. Typically, a readObject method will register the object with the stream so that when all of the objects are restored a final set of validations can be performed.

Parameters
obj:ObjectInputValidation

Doc from java.io.ObjectInputStream.registerValidation.

the object to receive the validation callback.

prio:int

Doc from java.io.ObjectInputStream.registerValidation.

controls the order of callbacks; zero is a good default. Use higher numbers to be called back earlier, lower numbers for later callbacks. Within a priority, callbacks are processed in no particular order.

Exceptions
NotActiveException:

Doc from java.io.ObjectInputStream.registerValidation.

The stream is not currently reading objects so it is invalid to register a callback.

InvalidObjectException:

Doc from java.io.ObjectInputStream.registerValidation.

The validation object is null.

skipback to summary
public long skip(final long n) throws IOException

Overrides org.jboss.marshalling.MarshallerObjectInputStream.skip.

Implements org.jboss.marshalling.ByteInput.skip, java.io.ObjectInput.skip.

Doc from org.jboss.marshalling.MarshallerObjectInputStream.skip.

Skips over and discards up to n bytes of data from this input stream. If the end of stream is reached, this method returns 0 in order to be consistent with java.io.InputStream#skip(long).

Parameters
n:long

Doc from org.jboss.marshalling.ByteInput.skip.

the number of bytes to attempt to skip

Returns:long

Doc from org.jboss.marshalling.ByteInput.skip.

the number of bytes skipped

Exceptions
IOException:

Doc from org.jboss.marshalling.ByteInput.skip.

if an error occurs

skipBytesback to summary
public int skipBytes(final int len) throws IOException

Overrides org.jboss.marshalling.MarshallerObjectInputStream.skipBytes.

Implements java.io.DataInput.skipBytes.

Doc from org.jboss.marshalling.MarshallerObjectInputStream.skipBytes.

Skips bytes.

Parameters
len:int

Doc from java.io.ObjectInputStream.skipBytes.

the number of bytes to be skipped

Returns:int

Doc from java.io.ObjectInputStream.skipBytes.

the actual number of bytes skipped.

Exceptions
IOException:

Doc from java.io.ObjectInputStream.skipBytes.

If an I/O error has occurred.

startback to summary
protected int start()
swapClassback to summary
protected SerializableClassDescriptor swapClass(final SerializableClassDescriptor descriptor)
swapCurrentback to summary
protected Object swapCurrent(final Object obj)