Package org.jboss.marshalling
Class UnmarshallingObjectInputStream
java.lang.Object
java.io.InputStream
java.io.ObjectInputStream
org.jboss.marshalling.UnmarshallingObjectInputStream
- All Implemented Interfaces:
Closeable
,DataInput
,ObjectInput
,ObjectStreamConstants
,AutoCloseable
An object input stream which wraps an
Unmarshaller
, which may be used by legacy ObjectInputStream
-based
applications that wish to use the marshalling framework.-
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
ConstructorsConstructorDescriptionUnmarshallingObjectInputStream
(Unmarshaller unmarshaller, InputStream stream) Construct a new instance which delegates to the given unmarshaller, reading from the given input.UnmarshallingObjectInputStream
(Unmarshaller unmarshaller, ByteInput byteInput) Construct a new instance which delegates to the given unmarshaller, reading from the given input. -
Method Summary
Modifier and TypeMethodDescriptionint
void
close()
void
May not be invoked in this context.protected final boolean
enableResolveObject
(boolean enable) int
read()
int
read
(byte[] b) int
read
(byte[] b, int off, int len) boolean
byte
readByte()
char
readChar()
protected final ObjectStreamClass
double
May not be invoked in this context.float
void
readFully
(byte[] b) void
readFully
(byte[] b, int off, int len) int
readInt()
readLine()
Deprecated.long
readLong()
protected Object
short
protected final void
int
int
readUTF()
void
registerValidation
(ObjectInputValidation obj, int prio) May not be invoked in this context.protected final Class<?>
protected final Object
resolveObject
(Object obj) protected final Class<?>
resolveProxyClass
(String[] interfaces) long
skip
(long n) int
skipBytes
(int n) Methods inherited from class java.io.ObjectInputStream
getObjectInputFilter, readObject, setObjectInputFilter
Methods inherited from class java.io.InputStream
mark, markSupported, nullInputStream, readAllBytes, readNBytes, readNBytes, reset, skipNBytes, transferTo
-
Field Details
-
unmarshaller
-
-
Constructor Details
-
UnmarshallingObjectInputStream
public UnmarshallingObjectInputStream(Unmarshaller unmarshaller, InputStream stream) throws IOException, SecurityException Construct a new instance which delegates to the given unmarshaller, reading from the given input. The unmarshaller will read from the input stream until it is closed.- Parameters:
unmarshaller
- the delegate unmarshallerstream
- the input stream to read from- Throws:
IOException
- if an I/O error occursSecurityException
- if the caller does not have permission to construct an instance of this class
-
UnmarshallingObjectInputStream
public UnmarshallingObjectInputStream(Unmarshaller unmarshaller, ByteInput byteInput) throws IOException, SecurityException Construct a new instance which delegates to the given unmarshaller, reading from the given input. The unmarshaller will read from the input stream until it is closed.- Parameters:
unmarshaller
- the delegate unmarshallerbyteInput
- the input stream to read from- 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:
ClassNotFoundException
IOException
-
read
- Specified by:
read
in interfaceObjectInput
- Overrides:
read
in classObjectInputStream
- Throws:
IOException
-
read
- Specified by:
read
in interfaceObjectInput
- Overrides:
read
in classInputStream
- Throws:
IOException
-
read
- Specified by:
read
in interfaceObjectInput
- Overrides:
read
in classObjectInputStream
- Throws:
IOException
-
skip
- Specified by:
skip
in interfaceObjectInput
- Overrides:
skip
in classInputStream
- Throws:
IOException
-
available
- Specified by:
available
in interfaceObjectInput
- Overrides:
available
in classObjectInputStream
- Throws:
IOException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceObjectInput
- Overrides:
close
in classObjectInputStream
- Throws:
IOException
IllegalStateException
-
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
-
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
-
readShort
- Specified by:
readShort
in interfaceDataInput
- Overrides:
readShort
in classObjectInputStream
- Throws:
IOException
-
readUnsignedShort
- Specified by:
readUnsignedShort
in interfaceDataInput
- Overrides:
readUnsignedShort
in classObjectInputStream
- Throws:
IOException
-
readChar
- Specified by:
readChar
in interfaceDataInput
- Overrides:
readChar
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
-
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
-
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
May not be invoked in this context.- Overrides:
defaultReadObject
in classObjectInputStream
- Throws:
IllegalStateException
- always
-
readFields
May not be invoked in this context.- Overrides:
readFields
in classObjectInputStream
- Throws:
IllegalStateException
- always
-
registerValidation
May not be invoked in this context.- Overrides:
registerValidation
in classObjectInputStream
- Parameters:
obj
- ignoredprio
- ignored- Throws:
IllegalStateException
- always