Package org.jboss.marshalling
Class MarshallerObjectInputStream
java.lang.Object
java.io.InputStream
java.io.ObjectInputStream
org.jboss.marshalling.MarshallerObjectInputStream
- All Implemented Interfaces:
Closeable
,DataInput
,ObjectInput
,ObjectStreamConstants
,AutoCloseable
,ByteInput
- Direct Known Subclasses:
RiverObjectInputStream
,SerializingCloner.StepObjectInputStream
,SerialObjectInputStream
A marshaller's object input stream. Used by marshallers for compatibility with Java serialization. Instances of
this class may be passed in to the overridden serialization methods for a class implementing
Serializable
.
This class is not part of the marshalling API; rather it is intended for marshaller implementers to make it easier to develop Java serialization-compatible marshallers.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.io.ObjectInputStream
ObjectInputStream.GetField
-
Field Summary
FieldsFields 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
ConstructorsModifierConstructorDescriptionprotected
Construct a new instance which delegates to the given unmarshaller. -
Method Summary
Modifier and TypeMethodDescriptionint
Returns an estimate of the number of bytes that can be read (or skipped over) from this input stream without blocking by the next invocation of a method for this input stream.final void
close()
abstract void
protected final boolean
enableResolveObject
(boolean enable) final void
mark
(int readlimit) final boolean
int
read()
Reads the next byte of data from the input stream.int
read
(byte[] buf) Read some bytes from the input stream into the given array.int
read
(byte[] buf, int off, int len) Read some bytes from the input stream into the given array.boolean
byte
readByte()
char
readChar()
protected final ObjectStreamClass
double
abstract ObjectInputStream.GetField
float
void
readFully
(byte[] buf) void
readFully
(byte[] buf, int off, int len) int
readInt()
readLine()
Deprecated.long
readLong()
protected Object
short
protected final void
int
int
readUTF()
abstract void
registerValidation
(ObjectInputValidation obj, int prio) final void
reset()
protected final Class<?>
protected final Object
resolveObject
(Object obj) protected final Class<?>
resolveProxyClass
(String[] interfaces) long
skip
(long n) Skips over and discards up ton
bytes of data from this input stream.int
skipBytes
(int len) Methods inherited from class java.io.ObjectInputStream
getObjectInputFilter, readObject, setObjectInputFilter
Methods inherited from class java.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, skipNBytes, transferTo
-
Field Details
-
input
-
-
Constructor Details
-
MarshallerObjectInputStream
Construct a new instance which delegates to the given unmarshaller.- Parameters:
input
- the delegate unmarshaller- Throws:
IOException
- if an I/O error occursSecurityException
- if the caller does not have permission to construct an instance of this class
-
-
Method Details
-
readObjectOverride
- Overrides:
readObjectOverride
in classObjectInputStream
- Throws:
IOException
ClassNotFoundException
-
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.- Specified by:
read
in interfaceByteInput
- Specified by:
read
in interfaceObjectInput
- Overrides:
read
in classObjectInputStream
- Returns:
- the next byte, or -1 if the end of stream has been reached
- Throws:
IOException
- if an error occurs
-
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.- Specified by:
read
in interfaceByteInput
- Specified by:
read
in interfaceObjectInput
- Overrides:
read
in classInputStream
- Parameters:
buf
- the destination array- Returns:
- the number of bytes read (possibly zero), or -1 if the end of stream has been reached
- Throws:
IOException
- if an error occurs
-
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.- Specified by:
read
in interfaceByteInput
- Specified by:
read
in interfaceObjectInput
- Overrides:
read
in classObjectInputStream
- 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:
IOException
- if an error occurs
-
available
Returns an estimate of the number of bytes that can be read (or skipped over) from this input stream without blocking by the next invocation of a method for this input stream.- Specified by:
available
in interfaceByteInput
- Specified by:
available
in interfaceObjectInput
- Overrides:
available
in classObjectInputStream
- Returns:
- the number of bytes
- Throws:
IOException
- if an error occurs
-
readBoolean
- Specified by:
readBoolean
in interfaceDataInput
- Overrides:
readBoolean
in classObjectInputStream
- Throws:
IOException
-
readByte
- Specified by:
readByte
in interfaceDataInput
- Overrides:
readByte
in classObjectInputStream
- Throws:
IOException
-
readUnsignedByte
- Specified by:
readUnsignedByte
in interfaceDataInput
- Overrides:
readUnsignedByte
in classObjectInputStream
- Throws:
IOException
-
readChar
- Specified by:
readChar
in interfaceDataInput
- Overrides:
readChar
in classObjectInputStream
- Throws:
IOException
-
readShort
- Specified by:
readShort
in interfaceDataInput
- Overrides:
readShort
in classObjectInputStream
- Throws:
IOException
-
readUnsignedShort
- Specified by:
readUnsignedShort
in interfaceDataInput
- Overrides:
readUnsignedShort
in classObjectInputStream
- Throws:
IOException
-
readInt
- Specified by:
readInt
in interfaceDataInput
- Overrides:
readInt
in classObjectInputStream
- Throws:
IOException
-
readLong
- Specified by:
readLong
in interfaceDataInput
- Overrides:
readLong
in classObjectInputStream
- Throws:
IOException
-
readFloat
- Specified by:
readFloat
in interfaceDataInput
- Overrides:
readFloat
in classObjectInputStream
- Throws:
IOException
-
readDouble
- Specified by:
readDouble
in interfaceDataInput
- Overrides:
readDouble
in classObjectInputStream
- Throws:
IOException
-
readFully
- Specified by:
readFully
in interfaceDataInput
- Overrides:
readFully
in classObjectInputStream
- Throws:
IOException
-
readFully
- Specified by:
readFully
in interfaceDataInput
- Overrides:
readFully
in classObjectInputStream
- Throws:
IOException
-
skipBytes
- Specified by:
skipBytes
in interfaceDataInput
- Overrides:
skipBytes
in classObjectInputStream
- Throws:
IOException
-
readLine
Deprecated.- Specified by:
readLine
in interfaceDataInput
- Overrides:
readLine
in classObjectInputStream
- Throws:
IOException
-
readUTF
- Specified by:
readUTF
in interfaceDataInput
- Overrides:
readUTF
in classObjectInputStream
- Throws:
IOException
-
skip
Skips over and discards up ton
bytes of data from this input stream. If the end of stream is reached, this method returns0
in order to be consistent withInputStream.skip(long)
.- Specified by:
skip
in interfaceByteInput
- Specified by:
skip
in interfaceObjectInput
- Overrides:
skip
in classInputStream
- Parameters:
n
- the number of bytes to attempt to skip- Returns:
- the number of bytes skipped
- Throws:
IOException
- if an error occurs
-
mark
public final void mark(int readlimit) - Overrides:
mark
in classInputStream
-
reset
- Overrides:
reset
in classInputStream
- Throws:
IOException
-
markSupported
public final boolean markSupported()- Overrides:
markSupported
in classInputStream
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceObjectInput
- Overrides:
close
in classObjectInputStream
- Throws:
IllegalStateException
-
resolveClass
- Overrides:
resolveClass
in classObjectInputStream
- Throws:
IllegalStateException
-
resolveProxyClass
- Overrides:
resolveProxyClass
in classObjectInputStream
- Throws:
IllegalStateException
-
resolveObject
- Overrides:
resolveObject
in classObjectInputStream
- Throws:
IllegalStateException
-
enableResolveObject
- Overrides:
enableResolveObject
in classObjectInputStream
- Throws:
IllegalStateException
-
readStreamHeader
- Overrides:
readStreamHeader
in classObjectInputStream
- Throws:
IllegalStateException
-
readClassDescriptor
- Overrides:
readClassDescriptor
in classObjectInputStream
- Throws:
IllegalStateException
-
defaultReadObject
- Overrides:
defaultReadObject
in classObjectInputStream
- Throws:
IOException
ClassNotFoundException
-
readFields
- Overrides:
readFields
in classObjectInputStream
- Throws:
IOException
ClassNotFoundException
-
registerValidation
public abstract void registerValidation(ObjectInputValidation obj, int prio) throws NotActiveException, InvalidObjectException - Overrides:
registerValidation
in classObjectInputStream
- Throws:
NotActiveException
InvalidObjectException
-