Package org.jboss.marshalling.river
Class RiverObjectInputStream
- java.lang.Object
-
- java.io.InputStream
-
- java.io.ObjectInputStream
-
- org.jboss.marshalling.MarshallerObjectInputStream
-
- org.jboss.marshalling.river.RiverObjectInputStream
-
- All Implemented Interfaces:
java.io.Closeable,java.io.DataInput,java.io.ObjectInput,java.io.ObjectStreamConstants,java.lang.AutoCloseable,ByteInput
public class RiverObjectInputStream extends MarshallerObjectInputStream
-
-
Field Summary
Fields Modifier and Type Field Description private BlockUnmarshallerblockUnmarshallerprivate java.lang.Objectcurrentprivate static intOFFprivate static intONprivate intrestoreIdxprivate SerializableClassDescriptorserializableClassDescriptorprivate intstateprivate RiverUnmarshallerunmarshallerprivate static intUNREAD_FIELDSprivate static intUNREAD_FIELDS_EOB-
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, SERIAL_FILTER_PERMISSION, 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
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedRiverObjectInputStream(RiverUnmarshaller riverUnmarshaller, BlockUnmarshaller delegateUnmarshaller)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description private voidcheckState()voiddefaultReadObject()(package private) voiddiscardReadObject()protected voidfinish(int restoreState)protected voidfullReset()private intgetAndSet(int set)protected intgetRestoreIdx()protected voidnoCustomData()intread()Reads the next byte of data from the input stream.intread(byte[] buf)Read some bytes from the input stream into the given array.intread(byte[] buf, int off, int len)Read some bytes from the input stream into the given array.booleanreadBoolean()bytereadByte()charreadChar()doublereadDouble()java.io.ObjectInputStream.GetFieldreadFields()floatreadFloat()voidreadFully(byte[] buf)voidreadFully(byte[] buf, int off, int len)intreadInt()java.lang.StringreadLine()Deprecated.longreadLong()protected java.lang.ObjectreadObjectOverride()shortreadShort()java.lang.ObjectreadUnshared()intreadUnsignedByte()intreadUnsignedShort()java.lang.StringreadUTF()voidregisterValidation(java.io.ObjectInputValidation obj, int prio)longskip(long n)Skips over and discards up tonbytes of data from this input stream.intskipBytes(int len)protected intstart()protected SerializableClassDescriptorswapClass(SerializableClassDescriptor descriptor)protected java.lang.ObjectswapCurrent(java.lang.Object obj)-
Methods inherited from class org.jboss.marshalling.MarshallerObjectInputStream
available, close, enableResolveObject, mark, markSupported, readClassDescriptor, readStreamHeader, reset, resolveClass, resolveObject, resolveProxyClass
-
Methods inherited from class java.io.ObjectInputStream
getObjectInputFilter, readObject, setObjectInputFilter
-
-
-
-
Field Detail
-
OFF
private static final int OFF
- See Also:
- Constant Field Values
-
UNREAD_FIELDS
private static final int UNREAD_FIELDS
- See Also:
- Constant Field Values
-
UNREAD_FIELDS_EOB
private static final int UNREAD_FIELDS_EOB
- See Also:
- Constant Field Values
-
ON
private static final int ON
- See Also:
- Constant Field Values
-
unmarshaller
private final RiverUnmarshaller unmarshaller
-
blockUnmarshaller
private final BlockUnmarshaller blockUnmarshaller
-
state
private int state
-
serializableClassDescriptor
private SerializableClassDescriptor serializableClassDescriptor
-
current
private java.lang.Object current
-
restoreIdx
private int restoreIdx
-
-
Constructor Detail
-
RiverObjectInputStream
protected RiverObjectInputStream(RiverUnmarshaller riverUnmarshaller, BlockUnmarshaller delegateUnmarshaller) throws java.io.IOException, java.lang.SecurityException
- Throws:
java.io.IOExceptionjava.lang.SecurityException
-
-
Method Detail
-
getAndSet
private int getAndSet(int set)
-
defaultReadObject
public void defaultReadObject() throws java.io.IOException, java.lang.ClassNotFoundExceptionDescription copied from class:MarshallerObjectInputStream- Specified by:
defaultReadObjectin classMarshallerObjectInputStream- Throws:
java.io.IOExceptionjava.lang.ClassNotFoundException
-
discardReadObject
void discardReadObject() throws java.io.IOException- Throws:
java.io.IOException
-
readFields
public java.io.ObjectInputStream.GetField readFields() throws java.io.IOException, java.lang.ClassNotFoundExceptionDescription copied from class:MarshallerObjectInputStream- Specified by:
readFieldsin classMarshallerObjectInputStream- Throws:
java.io.IOExceptionjava.lang.ClassNotFoundException
-
registerValidation
public void registerValidation(java.io.ObjectInputValidation obj, int prio) throws java.io.NotActiveException, java.io.InvalidObjectExceptionDescription copied from class:MarshallerObjectInputStream- Specified by:
registerValidationin classMarshallerObjectInputStream- Throws:
java.io.NotActiveExceptionjava.io.InvalidObjectException
-
swapClass
protected SerializableClassDescriptor swapClass(SerializableClassDescriptor descriptor)
-
swapCurrent
protected java.lang.Object swapCurrent(java.lang.Object obj)
-
start
protected int start()
-
finish
protected void finish(int restoreState) throws java.io.IOException- Throws:
java.io.IOException
-
checkState
private void checkState() throws java.io.IOException- Throws:
java.io.IOException
-
readObjectOverride
protected java.lang.Object readObjectOverride() throws java.io.IOException, java.lang.ClassNotFoundExceptionDescription copied from class:MarshallerObjectInputStream- Overrides:
readObjectOverridein classMarshallerObjectInputStream- Throws:
java.io.IOExceptionjava.lang.ClassNotFoundException
-
readUnshared
public java.lang.Object readUnshared() throws java.io.IOException, java.lang.ClassNotFoundExceptionDescription copied from class:MarshallerObjectInputStream- Overrides:
readUnsharedin classMarshallerObjectInputStream- Throws:
java.io.IOExceptionjava.lang.ClassNotFoundException
-
read
public int read() throws java.io.IOExceptionDescription copied from class:MarshallerObjectInputStreamReads 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.- Specified by:
readin interfaceByteInput- Specified by:
readin interfacejava.io.ObjectInput- Overrides:
readin classMarshallerObjectInputStream- Returns:
- the next byte, or -1 if the end of stream has been reached
- Throws:
java.io.IOException- if an error occurs
-
read
public int read(byte[] buf) throws java.io.IOExceptionDescription copied from class:MarshallerObjectInputStreamRead 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.- Specified by:
readin interfaceByteInput- Specified by:
readin interfacejava.io.ObjectInput- Overrides:
readin classMarshallerObjectInputStream- Parameters:
buf- the destination array- Returns:
- the number of bytes read (possibly zero), or -1 if the end of stream has been reached
- Throws:
java.io.IOException- if an error occurs
-
read
public int read(byte[] buf, int off, int len) throws java.io.IOExceptionDescription copied from class:MarshallerObjectInputStreamRead 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.- Specified by:
readin interfaceByteInput- Specified by:
readin interfacejava.io.ObjectInput- Overrides:
readin classMarshallerObjectInputStream- Parameters:
buf- the destination arrayoff- the offset into the array into which data should be readlen- the number of bytes to attempt to fill in the destination array- Returns:
- the number of bytes read (possibly zero), or -1 if the end of stream has been reached
- Throws:
java.io.IOException- if an error occurs
-
readBoolean
public boolean readBoolean() throws java.io.IOExceptionDescription copied from class:MarshallerObjectInputStream- Specified by:
readBooleanin interfacejava.io.DataInput- Overrides:
readBooleanin classMarshallerObjectInputStream- Throws:
java.io.IOException
-
readByte
public byte readByte() throws java.io.IOExceptionDescription copied from class:MarshallerObjectInputStream- Specified by:
readBytein interfacejava.io.DataInput- Overrides:
readBytein classMarshallerObjectInputStream- Throws:
java.io.IOException
-
readUnsignedByte
public int readUnsignedByte() throws java.io.IOExceptionDescription copied from class:MarshallerObjectInputStream- Specified by:
readUnsignedBytein interfacejava.io.DataInput- Overrides:
readUnsignedBytein classMarshallerObjectInputStream- Throws:
java.io.IOException
-
readChar
public char readChar() throws java.io.IOExceptionDescription copied from class:MarshallerObjectInputStream- Specified by:
readCharin interfacejava.io.DataInput- Overrides:
readCharin classMarshallerObjectInputStream- Throws:
java.io.IOException
-
readShort
public short readShort() throws java.io.IOExceptionDescription copied from class:MarshallerObjectInputStream- Specified by:
readShortin interfacejava.io.DataInput- Overrides:
readShortin classMarshallerObjectInputStream- Throws:
java.io.IOException
-
readUnsignedShort
public int readUnsignedShort() throws java.io.IOExceptionDescription copied from class:MarshallerObjectInputStream- Specified by:
readUnsignedShortin interfacejava.io.DataInput- Overrides:
readUnsignedShortin classMarshallerObjectInputStream- Throws:
java.io.IOException
-
readInt
public int readInt() throws java.io.IOExceptionDescription copied from class:MarshallerObjectInputStream- Specified by:
readIntin interfacejava.io.DataInput- Overrides:
readIntin classMarshallerObjectInputStream- Throws:
java.io.IOException
-
readLong
public long readLong() throws java.io.IOExceptionDescription copied from class:MarshallerObjectInputStream- Specified by:
readLongin interfacejava.io.DataInput- Overrides:
readLongin classMarshallerObjectInputStream- Throws:
java.io.IOException
-
readFloat
public float readFloat() throws java.io.IOExceptionDescription copied from class:MarshallerObjectInputStream- Specified by:
readFloatin interfacejava.io.DataInput- Overrides:
readFloatin classMarshallerObjectInputStream- Throws:
java.io.IOException
-
readDouble
public double readDouble() throws java.io.IOExceptionDescription copied from class:MarshallerObjectInputStream- Specified by:
readDoublein interfacejava.io.DataInput- Overrides:
readDoublein classMarshallerObjectInputStream- Throws:
java.io.IOException
-
readFully
public void readFully(byte[] buf) throws java.io.IOExceptionDescription copied from class:MarshallerObjectInputStream- Specified by:
readFullyin interfacejava.io.DataInput- Overrides:
readFullyin classMarshallerObjectInputStream- Throws:
java.io.IOException
-
readFully
public void readFully(byte[] buf, int off, int len) throws java.io.IOExceptionDescription copied from class:MarshallerObjectInputStream- Specified by:
readFullyin interfacejava.io.DataInput- Overrides:
readFullyin classMarshallerObjectInputStream- Throws:
java.io.IOException
-
skipBytes
public int skipBytes(int len) throws java.io.IOExceptionDescription copied from class:MarshallerObjectInputStream- Specified by:
skipBytesin interfacejava.io.DataInput- Overrides:
skipBytesin classMarshallerObjectInputStream- Throws:
java.io.IOException
-
readLine
@Deprecated public java.lang.String readLine() throws java.io.IOExceptionDeprecated.Description copied from class:MarshallerObjectInputStream- Specified by:
readLinein interfacejava.io.DataInput- Overrides:
readLinein classMarshallerObjectInputStream- Throws:
java.io.IOException
-
readUTF
public java.lang.String readUTF() throws java.io.IOExceptionDescription copied from class:MarshallerObjectInputStream- Specified by:
readUTFin interfacejava.io.DataInput- Overrides:
readUTFin classMarshallerObjectInputStream- Throws:
java.io.IOException
-
skip
public long skip(long n) throws java.io.IOExceptionDescription copied from class:MarshallerObjectInputStreamSkips over and discards up tonbytes of data from this input stream. If the end of stream is reached, this method returns0in order to be consistent withInputStream.skip(long).- Specified by:
skipin interfaceByteInput- Specified by:
skipin interfacejava.io.ObjectInput- Overrides:
skipin classMarshallerObjectInputStream- Parameters:
n- the number of bytes to attempt to skip- Returns:
- the number of bytes skipped
- Throws:
java.io.IOException- if an error occurs
-
fullReset
protected void fullReset()
-
noCustomData
protected void noCustomData()
-
getRestoreIdx
protected int getRestoreIdx()
-
-