Class ObjectDecoderInputStream
- java.lang.Object
-
- java.io.InputStream
-
- io.netty.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 int
available()
void
close()
void
mark(int readlimit)
boolean
markSupported()
int
read()
int
read(byte[] b)
int
read(byte[] b, int off, int len)
boolean
readBoolean()
byte
readByte()
char
readChar()
double
readDouble()
float
readFloat()
void
readFully(byte[] b)
void
readFully(byte[] b, int off, int len)
int
readInt()
String
readLine()
Deprecated.UseBufferedReader.readLine()
instead.long
readLong()
Object
readObject()
short
readShort()
int
readUnsignedByte()
int
readUnsignedShort()
String
readUTF()
void
reset()
long
skip(long n)
int
skipBytes(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
- theInputStream
where the serialized form will be read from
-
ObjectDecoderInputStream
public ObjectDecoderInputStream(InputStream in, ClassLoader classLoader)
Creates a newObjectInput
.- Parameters:
in
- theInputStream
where the serialized form will be read fromclassLoader
- theClassLoader
which will load the class of the serialized object
-
ObjectDecoderInputStream
public ObjectDecoderInputStream(InputStream in, int maxObjectSize)
Creates a newObjectInput
.- Parameters:
in
- theInputStream
where 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, aStreamCorruptedException
will be raised.
-
ObjectDecoderInputStream
public ObjectDecoderInputStream(InputStream in, ClassLoader classLoader, int maxObjectSize)
Creates a newObjectInput
.- Parameters:
in
- theInputStream
where the serialized form will be read fromclassLoader
- theClassLoader
which 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, aStreamCorruptedException
will be raised.
-
-
Method Detail
-
readObject
public Object readObject() throws ClassNotFoundException, IOException
- Specified by:
readObject
in interfaceObjectInput
- Throws:
ClassNotFoundException
IOException
-
available
public int available() throws IOException
- Specified by:
available
in interfaceObjectInput
- Overrides:
available
in classInputStream
- Throws:
IOException
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceObjectInput
- Overrides:
close
in classInputStream
- Throws:
IOException
-
mark
public void mark(int readlimit)
- Overrides:
mark
in classInputStream
-
markSupported
public boolean markSupported()
- Overrides:
markSupported
in classInputStream
-
read
public int read() throws IOException
- Specified by:
read
in interfaceObjectInput
- Specified by:
read
in classInputStream
- Throws:
IOException
-
read
public final int read(byte[] b, int off, int len) throws IOException
- Specified by:
read
in interfaceObjectInput
- Overrides:
read
in classInputStream
- Throws:
IOException
-
read
public final int read(byte[] b) throws IOException
- Specified by:
read
in interfaceObjectInput
- Overrides:
read
in classInputStream
- Throws:
IOException
-
readBoolean
public final boolean readBoolean() throws IOException
- Specified by:
readBoolean
in interfaceDataInput
- Throws:
IOException
-
readByte
public final byte readByte() throws IOException
- Specified by:
readByte
in interfaceDataInput
- Throws:
IOException
-
readChar
public final char readChar() throws IOException
- Specified by:
readChar
in interfaceDataInput
- Throws:
IOException
-
readDouble
public final double readDouble() throws IOException
- Specified by:
readDouble
in interfaceDataInput
- Throws:
IOException
-
readFloat
public final float readFloat() throws IOException
- Specified by:
readFloat
in interfaceDataInput
- Throws:
IOException
-
readFully
public final void readFully(byte[] b, int off, int len) throws IOException
- Specified by:
readFully
in interfaceDataInput
- Throws:
IOException
-
readFully
public final void readFully(byte[] b) throws IOException
- Specified by:
readFully
in interfaceDataInput
- Throws:
IOException
-
readInt
public final int readInt() throws IOException
- Specified by:
readInt
in interfaceDataInput
- Throws:
IOException
-
readLine
@Deprecated public final String readLine() throws IOException
Deprecated.UseBufferedReader.readLine()
instead.- Specified by:
readLine
in interfaceDataInput
- Throws:
IOException
-
readLong
public final long readLong() throws IOException
- Specified by:
readLong
in interfaceDataInput
- Throws:
IOException
-
readShort
public final short readShort() throws IOException
- Specified by:
readShort
in interfaceDataInput
- Throws:
IOException
-
readUnsignedByte
public final int readUnsignedByte() throws IOException
- Specified by:
readUnsignedByte
in interfaceDataInput
- Throws:
IOException
-
readUnsignedShort
public final int readUnsignedShort() throws IOException
- Specified by:
readUnsignedShort
in interfaceDataInput
- Throws:
IOException
-
readUTF
public final String readUTF() throws IOException
- Specified by:
readUTF
in interfaceDataInput
- Throws:
IOException
-
reset
public void reset() throws IOException
- Overrides:
reset
in classInputStream
- Throws:
IOException
-
skip
public long skip(long n) throws IOException
- Specified by:
skip
in interfaceObjectInput
- Overrides:
skip
in classInputStream
- Throws:
IOException
-
skipBytes
public final int skipBytes(int n) throws IOException
- Specified by:
skipBytes
in interfaceDataInput
- Throws:
IOException
-
-