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
public abstract class MarshallerObjectInputStream extends ObjectInputStream implements ByteInput
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 implementingSerializable.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
-
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 protectedMarshallerObjectInputStream(Unmarshaller input)Construct a new instance which delegates to the given unmarshaller.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description intavailable()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.voidclose()abstract voiddefaultReadObject()protected booleanenableResolveObject(boolean enable)voidmark(int readlimit)booleanmarkSupported()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()protected ObjectStreamClassreadClassDescriptor()doublereadDouble()abstract ObjectInputStream.GetFieldreadFields()floatreadFloat()voidreadFully(byte[] buf)voidreadFully(byte[] buf, int off, int len)intreadInt()StringreadLine()Deprecated.longreadLong()protected ObjectreadObjectOverride()shortreadShort()protected voidreadStreamHeader()ObjectreadUnshared()intreadUnsignedByte()intreadUnsignedShort()StringreadUTF()abstract voidregisterValidation(ObjectInputValidation obj, int prio)voidreset()protected Class<?>resolveClass(ObjectStreamClass desc)protected ObjectresolveObject(Object obj)protected Class<?>resolveProxyClass(String[] interfaces)longskip(long n)Skips over and discards up tonbytes of data from this input stream.intskipBytes(int len)-
Methods inherited from class java.io.ObjectInputStream
getObjectInputFilter, readObject, setObjectInputFilter
-
Methods inherited from class java.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, transferTo
-
-
-
-
Constructor Detail
-
MarshallerObjectInputStream
protected MarshallerObjectInputStream(Unmarshaller input) throws IOException, SecurityException
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 Detail
-
readObjectOverride
protected Object readObjectOverride() throws IOException, ClassNotFoundException
- Overrides:
readObjectOverridein classObjectInputStream- Throws:
IOExceptionClassNotFoundException
-
readUnshared
public Object readUnshared() throws IOException, ClassNotFoundException
- Overrides:
readUnsharedin classObjectInputStream- Throws:
IOExceptionClassNotFoundException
-
read
public int read() throws IOExceptionReads 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 interfaceObjectInput- Overrides:
readin classObjectInputStream- Returns:
- the next byte, or -1 if the end of stream has been reached
- Throws:
IOException- if an error occurs
-
read
public int read(byte[] buf) throws IOExceptionRead 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 interfaceObjectInput- Overrides:
readin 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
public int read(byte[] buf, int off, int len) throws IOExceptionRead 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 interfaceObjectInput- Overrides:
readin 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
public int available() throws IOExceptionReturns 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:
availablein interfaceByteInput- Specified by:
availablein interfaceObjectInput- Overrides:
availablein classObjectInputStream- Returns:
- the number of bytes
- Throws:
IOException- if an error occurs
-
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
-
readChar
public char readChar() throws IOException- Specified by:
readCharin interfaceDataInput- Overrides:
readCharin 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
-
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
-
readFully
public void readFully(byte[] buf) throws IOException- Specified by:
readFullyin interfaceDataInput- Overrides:
readFullyin classObjectInputStream- Throws:
IOException
-
readFully
public void readFully(byte[] buf, int off, int len) throws IOException- Specified by:
readFullyin interfaceDataInput- Overrides:
readFullyin classObjectInputStream- Throws:
IOException
-
skipBytes
public int skipBytes(int len) throws IOException- Specified by:
skipBytesin interfaceDataInput- Overrides:
skipBytesin 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
-
skip
public long skip(long n) throws IOExceptionSkips 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 interfaceObjectInput- Overrides:
skipin 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:
markin classInputStream
-
reset
public final void reset() throws IOException- Overrides:
resetin classInputStream- Throws:
IOException
-
markSupported
public final boolean markSupported()
- Overrides:
markSupportedin classInputStream
-
close
public final void close() throws IllegalStateException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceObjectInput- Overrides:
closein classObjectInputStream- Throws:
IllegalStateException
-
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 abstract void defaultReadObject() throws IOException, ClassNotFoundException- Overrides:
defaultReadObjectin classObjectInputStream- Throws:
IOExceptionClassNotFoundException
-
readFields
public abstract ObjectInputStream.GetField readFields() throws IOException, ClassNotFoundException
- Overrides:
readFieldsin classObjectInputStream- Throws:
IOExceptionClassNotFoundException
-
registerValidation
public abstract void registerValidation(ObjectInputValidation obj, int prio) throws NotActiveException, InvalidObjectException
- Overrides:
registerValidationin classObjectInputStream- Throws:
NotActiveExceptionInvalidObjectException
-
-