Class ObjectDecoderInputStream
- java.lang.Object
-
- java.io.InputStream
-
- io.netty.contrib.handler.codec.serialization.ObjectDecoderInputStream
-
- All Implemented Interfaces:
Closeable,DataInput,ObjectInput,AutoCloseable
public class ObjectDecoderInputStream extends InputStream implements ObjectInput
-
-
Constructor Summary
Constructors Constructor Description ObjectDecoderInputStream(InputStream in)Creates a newObjectInput.ObjectDecoderInputStream(InputStream in, int maxObjectSize)Creates a newObjectInput.ObjectDecoderInputStream(InputStream in, ClassLoader classLoader)Creates a newObjectInput.ObjectDecoderInputStream(InputStream in, ClassLoader classLoader, int maxObjectSize)Creates a newObjectInput.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description intavailable()voidclose()voidmark(int readlimit)booleanmarkSupported()intread()intread(byte[] b)intread(byte[] b, int off, int len)booleanreadBoolean()bytereadByte()charreadChar()doublereadDouble()floatreadFloat()voidreadFully(byte[] b)voidreadFully(byte[] b, int off, int len)intreadInt()StringreadLine()Deprecated.UseBufferedReader.readLine()instead.longreadLong()ObjectreadObject()shortreadShort()intreadUnsignedByte()intreadUnsignedShort()StringreadUTF()voidreset()longskip(long n)intskipBytes(int n)-
Methods inherited from class java.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, transferTo
-
-
-
-
Constructor Detail
-
ObjectDecoderInputStream
public ObjectDecoderInputStream(InputStream in)
Creates a newObjectInput.- Parameters:
in- theInputStreamwhere the serialized form will be read from
-
ObjectDecoderInputStream
public ObjectDecoderInputStream(InputStream in, ClassLoader classLoader)
Creates a newObjectInput.- Parameters:
in- theInputStreamwhere the serialized form will be read fromclassLoader- theClassLoaderwhich will load the class of the serialized object
-
ObjectDecoderInputStream
public ObjectDecoderInputStream(InputStream in, int maxObjectSize)
Creates a newObjectInput.- Parameters:
in- theInputStreamwhere the serialized form will be read frommaxObjectSize- the maximum byte length of the serialized object. if the length of the received object is greater than this value, aStreamCorruptedExceptionwill be raised.
-
ObjectDecoderInputStream
public ObjectDecoderInputStream(InputStream in, ClassLoader classLoader, int maxObjectSize)
Creates a newObjectInput.- Parameters:
in- theInputStreamwhere the serialized form will be read fromclassLoader- theClassLoaderwhich will load the class of the serialized objectmaxObjectSize- the maximum byte length of the serialized object. if the length of the received object is greater than this value, aStreamCorruptedExceptionwill be raised.
-
-
Method Detail
-
readObject
public Object readObject() throws ClassNotFoundException, IOException
- Specified by:
readObjectin interfaceObjectInput- Throws:
ClassNotFoundExceptionIOException
-
available
public int available() throws IOException- Specified by:
availablein interfaceObjectInput- Overrides:
availablein classInputStream- Throws:
IOException
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceObjectInput- Overrides:
closein classInputStream- Throws:
IOException
-
mark
public void mark(int readlimit)
- Overrides:
markin classInputStream
-
markSupported
public boolean markSupported()
- Overrides:
markSupportedin classInputStream
-
read
public int read() throws IOException- Specified by:
readin interfaceObjectInput- Specified by:
readin classInputStream- Throws:
IOException
-
read
public final int read(byte[] b, int off, int len) throws IOException- Specified by:
readin interfaceObjectInput- Overrides:
readin classInputStream- Throws:
IOException
-
read
public final int read(byte[] b) throws IOException- Specified by:
readin interfaceObjectInput- Overrides:
readin classInputStream- Throws:
IOException
-
readBoolean
public final boolean readBoolean() throws IOException- Specified by:
readBooleanin interfaceDataInput- Throws:
IOException
-
readByte
public final byte readByte() throws IOException- Specified by:
readBytein interfaceDataInput- Throws:
IOException
-
readChar
public final char readChar() throws IOException- Specified by:
readCharin interfaceDataInput- Throws:
IOException
-
readDouble
public final double readDouble() throws IOException- Specified by:
readDoublein interfaceDataInput- Throws:
IOException
-
readFloat
public final float readFloat() throws IOException- Specified by:
readFloatin interfaceDataInput- Throws:
IOException
-
readFully
public final void readFully(byte[] b, int off, int len) throws IOException- Specified by:
readFullyin interfaceDataInput- Throws:
IOException
-
readFully
public final void readFully(byte[] b) throws IOException- Specified by:
readFullyin interfaceDataInput- Throws:
IOException
-
readInt
public final int readInt() throws IOException- Specified by:
readIntin interfaceDataInput- Throws:
IOException
-
readLine
@Deprecated public final String readLine() throws IOException
Deprecated.UseBufferedReader.readLine()instead.- Specified by:
readLinein interfaceDataInput- Throws:
IOException
-
readLong
public final long readLong() throws IOException- Specified by:
readLongin interfaceDataInput- Throws:
IOException
-
readShort
public final short readShort() throws IOException- Specified by:
readShortin interfaceDataInput- Throws:
IOException
-
readUnsignedByte
public final int readUnsignedByte() throws IOException- Specified by:
readUnsignedBytein interfaceDataInput- Throws:
IOException
-
readUnsignedShort
public final int readUnsignedShort() throws IOException- Specified by:
readUnsignedShortin interfaceDataInput- Throws:
IOException
-
readUTF
public final String readUTF() throws IOException
- Specified by:
readUTFin interfaceDataInput- Throws:
IOException
-
reset
public void reset() throws IOException- Overrides:
resetin classInputStream- Throws:
IOException
-
skip
public long skip(long n) throws IOException- Specified by:
skipin interfaceObjectInput- Overrides:
skipin classInputStream- Throws:
IOException
-
skipBytes
public final int skipBytes(int n) throws IOException- Specified by:
skipBytesin interfaceDataInput- Throws:
IOException
-
-