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
public final class UnmarshallingObjectInputStream extends ObjectInputStream
An object input stream which wraps anUnmarshaller
, which may be used by legacyObjectInputStream
-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
-
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 Constructor Description UnmarshallingObjectInputStream(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
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description int
available()
void
close()
void
defaultReadObject()
May not be invoked in this context.protected boolean
enableResolveObject(boolean enable)
int
read()
int
read(byte[] b)
int
read(byte[] b, int off, int len)
boolean
readBoolean()
byte
readByte()
char
readChar()
protected ObjectStreamClass
readClassDescriptor()
double
readDouble()
ObjectInputStream.GetField
readFields()
May not be invoked in this context.float
readFloat()
void
readFully(byte[] b)
void
readFully(byte[] b, int off, int len)
int
readInt()
String
readLine()
Deprecated.long
readLong()
protected Object
readObjectOverride()
Object
readObjectUnshared()
short
readShort()
protected void
readStreamHeader()
Object
readUnshared()
int
readUnsignedByte()
int
readUnsignedShort()
String
readUTF()
void
registerValidation(ObjectInputValidation obj, int prio)
May not be invoked in this context.protected Class<?>
resolveClass(ObjectStreamClass desc)
protected Object
resolveObject(Object obj)
protected 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, transferTo
-
-
-
-
Constructor Detail
-
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 Detail
-
readUnshared
public Object readUnshared() throws IOException, ClassNotFoundException
- Overrides:
readUnshared
in classObjectInputStream
- Throws:
IOException
ClassNotFoundException
-
readObjectOverride
protected Object readObjectOverride() throws ClassNotFoundException, IOException
- Overrides:
readObjectOverride
in classObjectInputStream
- Throws:
ClassNotFoundException
IOException
-
read
public int read() throws IOException
- Specified by:
read
in interfaceObjectInput
- Overrides:
read
in classObjectInputStream
- Throws:
IOException
-
read
public int read(byte[] b) throws IOException
- Specified by:
read
in interfaceObjectInput
- Overrides:
read
in classInputStream
- Throws:
IOException
-
read
public int read(byte[] b, int off, int len) throws IOException
- Specified by:
read
in interfaceObjectInput
- Overrides:
read
in classObjectInputStream
- Throws:
IOException
-
skip
public long skip(long n) throws IOException
- Specified by:
skip
in interfaceObjectInput
- Overrides:
skip
in classInputStream
- Throws:
IOException
-
available
public int available() throws IOException
- Specified by:
available
in interfaceObjectInput
- Overrides:
available
in classObjectInputStream
- Throws:
IOException
-
close
public void close() throws IOException, IllegalStateException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceObjectInput
- Overrides:
close
in classObjectInputStream
- Throws:
IOException
IllegalStateException
-
readFully
public void readFully(byte[] b) throws IOException
- Specified by:
readFully
in interfaceDataInput
- Overrides:
readFully
in classObjectInputStream
- Throws:
IOException
-
readFully
public void readFully(byte[] b, int off, int len) throws IOException
- Specified by:
readFully
in interfaceDataInput
- Overrides:
readFully
in classObjectInputStream
- Throws:
IOException
-
skipBytes
public int skipBytes(int n) throws IOException
- Specified by:
skipBytes
in interfaceDataInput
- Overrides:
skipBytes
in classObjectInputStream
- Throws:
IOException
-
readBoolean
public boolean readBoolean() throws IOException
- Specified by:
readBoolean
in interfaceDataInput
- Overrides:
readBoolean
in classObjectInputStream
- Throws:
IOException
-
readByte
public byte readByte() throws IOException
- Specified by:
readByte
in interfaceDataInput
- Overrides:
readByte
in classObjectInputStream
- Throws:
IOException
-
readUnsignedByte
public int readUnsignedByte() throws IOException
- Specified by:
readUnsignedByte
in interfaceDataInput
- Overrides:
readUnsignedByte
in classObjectInputStream
- Throws:
IOException
-
readShort
public short readShort() throws IOException
- Specified by:
readShort
in interfaceDataInput
- Overrides:
readShort
in classObjectInputStream
- Throws:
IOException
-
readUnsignedShort
public int readUnsignedShort() throws IOException
- Specified by:
readUnsignedShort
in interfaceDataInput
- Overrides:
readUnsignedShort
in classObjectInputStream
- Throws:
IOException
-
readChar
public char readChar() throws IOException
- Specified by:
readChar
in interfaceDataInput
- Overrides:
readChar
in classObjectInputStream
- Throws:
IOException
-
readInt
public int readInt() throws IOException
- Specified by:
readInt
in interfaceDataInput
- Overrides:
readInt
in classObjectInputStream
- Throws:
IOException
-
readLong
public long readLong() throws IOException
- Specified by:
readLong
in interfaceDataInput
- Overrides:
readLong
in classObjectInputStream
- Throws:
IOException
-
readFloat
public float readFloat() throws IOException
- Specified by:
readFloat
in interfaceDataInput
- Overrides:
readFloat
in classObjectInputStream
- Throws:
IOException
-
readDouble
public double readDouble() throws IOException
- Specified by:
readDouble
in interfaceDataInput
- Overrides:
readDouble
in classObjectInputStream
- Throws:
IOException
-
readLine
@Deprecated public String readLine() throws IOException
Deprecated.- Specified by:
readLine
in interfaceDataInput
- Overrides:
readLine
in classObjectInputStream
- Throws:
IOException
-
readUTF
public String readUTF() throws IOException
- Specified by:
readUTF
in interfaceDataInput
- Overrides:
readUTF
in classObjectInputStream
- Throws:
IOException
-
readObjectUnshared
public Object readObjectUnshared() throws ClassNotFoundException, IOException
- Throws:
ClassNotFoundException
IOException
-
resolveClass
protected final Class<?> resolveClass(ObjectStreamClass desc) throws IllegalStateException
- Overrides:
resolveClass
in classObjectInputStream
- Throws:
IllegalStateException
-
resolveProxyClass
protected final Class<?> resolveProxyClass(String[] interfaces) throws IllegalStateException
- Overrides:
resolveProxyClass
in classObjectInputStream
- Throws:
IllegalStateException
-
resolveObject
protected final Object resolveObject(Object obj) throws IllegalStateException
- Overrides:
resolveObject
in classObjectInputStream
- Throws:
IllegalStateException
-
enableResolveObject
protected final boolean enableResolveObject(boolean enable) throws IllegalStateException
- Overrides:
enableResolveObject
in classObjectInputStream
- Throws:
IllegalStateException
-
readStreamHeader
protected final void readStreamHeader() throws IllegalStateException
- Overrides:
readStreamHeader
in classObjectInputStream
- Throws:
IllegalStateException
-
readClassDescriptor
protected final ObjectStreamClass readClassDescriptor() throws IllegalStateException
- Overrides:
readClassDescriptor
in classObjectInputStream
- Throws:
IllegalStateException
-
defaultReadObject
public void defaultReadObject() throws IllegalStateException
May not be invoked in this context.- Overrides:
defaultReadObject
in classObjectInputStream
- Throws:
IllegalStateException
- always
-
readFields
public ObjectInputStream.GetField readFields() throws IllegalStateException
May not be invoked in this context.- Overrides:
readFields
in classObjectInputStream
- Throws:
IllegalStateException
- always
-
registerValidation
public void registerValidation(ObjectInputValidation obj, int prio) throws IllegalStateException
May not be invoked in this context.- Overrides:
registerValidation
in classObjectInputStream
- Parameters:
obj
- ignoredprio
- ignored- Throws:
IllegalStateException
- always
-
-