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 intavailable()voidclose()voiddefaultReadObject()May not be invoked in this context.protected booleanenableResolveObject(boolean enable)intread()intread(byte[] b)intread(byte[] b, int off, int len)booleanreadBoolean()bytereadByte()charreadChar()protected ObjectStreamClassreadClassDescriptor()doublereadDouble()ObjectInputStream.GetFieldreadFields()May not be invoked in this context.floatreadFloat()voidreadFully(byte[] b)voidreadFully(byte[] b, int off, int len)intreadInt()StringreadLine()Deprecated.longreadLong()protected ObjectreadObjectOverride()ObjectreadObjectUnshared()shortreadShort()protected voidreadStreamHeader()ObjectreadUnshared()intreadUnsignedByte()intreadUnsignedShort()StringreadUTF()voidregisterValidation(ObjectInputValidation obj, int prio)May not be invoked in this context.protected Class<?>resolveClass(ObjectStreamClass desc)protected ObjectresolveObject(Object obj)protected Class<?>resolveProxyClass(String[] interfaces)longskip(long n)intskipBytes(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:
readUnsharedin classObjectInputStream- Throws:
IOExceptionClassNotFoundException
-
readObjectOverride
protected Object readObjectOverride() throws ClassNotFoundException, IOException
- Overrides:
readObjectOverridein classObjectInputStream- Throws:
ClassNotFoundExceptionIOException
-
read
public int read() throws IOException- Specified by:
readin interfaceObjectInput- Overrides:
readin classObjectInputStream- Throws:
IOException
-
read
public int read(byte[] b) throws IOException- Specified by:
readin interfaceObjectInput- Overrides:
readin classInputStream- Throws:
IOException
-
read
public int read(byte[] b, int off, int len) throws IOException- Specified by:
readin interfaceObjectInput- Overrides:
readin classObjectInputStream- Throws:
IOException
-
skip
public long skip(long n) throws IOException- Specified by:
skipin interfaceObjectInput- Overrides:
skipin classInputStream- Throws:
IOException
-
available
public int available() throws IOException- Specified by:
availablein interfaceObjectInput- Overrides:
availablein classObjectInputStream- Throws:
IOException
-
close
public void close() throws IOException, IllegalStateException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceObjectInput- Overrides:
closein classObjectInputStream- Throws:
IOExceptionIllegalStateException
-
readFully
public void readFully(byte[] b) throws IOException- Specified by:
readFullyin interfaceDataInput- Overrides:
readFullyin classObjectInputStream- Throws:
IOException
-
readFully
public void readFully(byte[] b, int off, int len) throws IOException- Specified by:
readFullyin interfaceDataInput- Overrides:
readFullyin classObjectInputStream- Throws:
IOException
-
skipBytes
public int skipBytes(int n) throws IOException- Specified by:
skipBytesin interfaceDataInput- Overrides:
skipBytesin classObjectInputStream- Throws:
IOException
-
readBoolean
public boolean readBoolean() throws IOException- Specified by:
readBooleanin interfaceDataInput- Overrides:
readBooleanin classObjectInputStream- Throws:
IOException
-
readByte
public byte readByte() throws IOException- Specified by:
readBytein interfaceDataInput- Overrides:
readBytein classObjectInputStream- Throws:
IOException
-
readUnsignedByte
public int readUnsignedByte() throws IOException- Specified by:
readUnsignedBytein interfaceDataInput- Overrides:
readUnsignedBytein classObjectInputStream- Throws:
IOException
-
readShort
public short readShort() throws IOException- Specified by:
readShortin interfaceDataInput- Overrides:
readShortin classObjectInputStream- Throws:
IOException
-
readUnsignedShort
public int readUnsignedShort() throws IOException- Specified by:
readUnsignedShortin interfaceDataInput- Overrides:
readUnsignedShortin classObjectInputStream- Throws:
IOException
-
readChar
public char readChar() throws IOException- Specified by:
readCharin interfaceDataInput- Overrides:
readCharin classObjectInputStream- Throws:
IOException
-
readInt
public int readInt() throws IOException- Specified by:
readIntin interfaceDataInput- Overrides:
readIntin classObjectInputStream- Throws:
IOException
-
readLong
public long readLong() throws IOException- Specified by:
readLongin interfaceDataInput- Overrides:
readLongin classObjectInputStream- Throws:
IOException
-
readFloat
public float readFloat() throws IOException- Specified by:
readFloatin interfaceDataInput- Overrides:
readFloatin classObjectInputStream- Throws:
IOException
-
readDouble
public double readDouble() throws IOException- Specified by:
readDoublein interfaceDataInput- Overrides:
readDoublein classObjectInputStream- Throws:
IOException
-
readLine
@Deprecated public String readLine() throws IOException
Deprecated.- Specified by:
readLinein interfaceDataInput- Overrides:
readLinein classObjectInputStream- Throws:
IOException
-
readUTF
public String readUTF() throws IOException
- Specified by:
readUTFin interfaceDataInput- Overrides:
readUTFin classObjectInputStream- Throws:
IOException
-
readObjectUnshared
public Object readObjectUnshared() throws ClassNotFoundException, IOException
- Throws:
ClassNotFoundExceptionIOException
-
resolveClass
protected final Class<?> resolveClass(ObjectStreamClass desc) throws IllegalStateException
- Overrides:
resolveClassin classObjectInputStream- Throws:
IllegalStateException
-
resolveProxyClass
protected final Class<?> resolveProxyClass(String[] interfaces) throws IllegalStateException
- Overrides:
resolveProxyClassin classObjectInputStream- Throws:
IllegalStateException
-
resolveObject
protected final Object resolveObject(Object obj) throws IllegalStateException
- Overrides:
resolveObjectin classObjectInputStream- Throws:
IllegalStateException
-
enableResolveObject
protected final boolean enableResolveObject(boolean enable) throws IllegalStateException- Overrides:
enableResolveObjectin classObjectInputStream- Throws:
IllegalStateException
-
readStreamHeader
protected final void readStreamHeader() throws IllegalStateException- Overrides:
readStreamHeaderin classObjectInputStream- Throws:
IllegalStateException
-
readClassDescriptor
protected final ObjectStreamClass readClassDescriptor() throws IllegalStateException
- Overrides:
readClassDescriptorin classObjectInputStream- Throws:
IllegalStateException
-
defaultReadObject
public void defaultReadObject() throws IllegalStateExceptionMay not be invoked in this context.- Overrides:
defaultReadObjectin classObjectInputStream- Throws:
IllegalStateException- always
-
readFields
public ObjectInputStream.GetField readFields() throws IllegalStateException
May not be invoked in this context.- Overrides:
readFieldsin classObjectInputStream- Throws:
IllegalStateException- always
-
registerValidation
public void registerValidation(ObjectInputValidation obj, int prio) throws IllegalStateException
May not be invoked in this context.- Overrides:
registerValidationin classObjectInputStream- Parameters:
obj- ignoredprio- ignored- Throws:
IllegalStateException- always
-
-