Class ObjectSerializationInputStream
- java.lang.Object
-
- java.io.InputStream
-
- org.apache.mina.filter.codec.serialization.ObjectSerializationInputStream
-
- All Implemented Interfaces:
Closeable
,DataInput
,ObjectInput
,AutoCloseable
public class ObjectSerializationInputStream extends InputStream implements ObjectInput
- Author:
- Apache MINA Project
-
-
Constructor Summary
Constructors Constructor Description ObjectSerializationInputStream(InputStream in)
Create a new instance of an ObjectSerializationInputStreamObjectSerializationInputStream(InputStream in, ClassLoader classLoader)
Create a new instance of an ObjectSerializationInputStream
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description int
getMaxObjectSize()
int
read()
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.Bytes are not properly converted to charslong
readLong()
Object
readObject()
short
readShort()
int
readUnsignedByte()
int
readUnsignedShort()
String
readUTF()
void
setMaxObjectSize(int maxObjectSize)
Sets the allowed maximum size of the object to be decoded.int
skipBytes(int n)
-
Methods inherited from class java.io.InputStream
available, close, mark, markSupported, read, read, reset, skip
-
-
-
-
Constructor Detail
-
ObjectSerializationInputStream
public ObjectSerializationInputStream(InputStream in)
Create a new instance of an ObjectSerializationInputStream- Parameters:
in
- TheInputStream
to use
-
ObjectSerializationInputStream
public ObjectSerializationInputStream(InputStream in, ClassLoader classLoader)
Create a new instance of an ObjectSerializationInputStream- Parameters:
in
- TheInputStream
to useclassLoader
- The class loader to use
-
-
Method Detail
-
getMaxObjectSize
public int getMaxObjectSize()
- Returns:
- the allowed maximum size of the object to be decoded.
If the size of the object to be decoded exceeds this value, this
decoder will throw a
BufferDataException
. The default value is1048576
(1MB).
-
setMaxObjectSize
public void setMaxObjectSize(int maxObjectSize)
Sets the allowed maximum size of the object to be decoded. If the size of the object to be decoded exceeds this value, this decoder will throw aBufferDataException
. The default value is1048576
(1MB).- Parameters:
maxObjectSize
- The maximum decoded object size
-
read
public int read() throws IOException
- Specified by:
read
in interfaceObjectInput
- Specified by:
read
in classInputStream
- Throws:
IOException
-
readObject
public Object readObject() throws ClassNotFoundException, IOException
- Specified by:
readObject
in interfaceObjectInput
- Throws:
ClassNotFoundException
IOException
-
readBoolean
public boolean readBoolean() throws IOException
- Specified by:
readBoolean
in interfaceDataInput
- Throws:
IOException
-
readByte
public byte readByte() throws IOException
- Specified by:
readByte
in interfaceDataInput
- Throws:
IOException
-
readChar
public char readChar() throws IOException
- Specified by:
readChar
in interfaceDataInput
- Throws:
IOException
-
readDouble
public double readDouble() throws IOException
- Specified by:
readDouble
in interfaceDataInput
- Throws:
IOException
-
readFloat
public float readFloat() throws IOException
- Specified by:
readFloat
in interfaceDataInput
- Throws:
IOException
-
readFully
public void readFully(byte[] b) throws IOException
- Specified by:
readFully
in interfaceDataInput
- Throws:
IOException
-
readFully
public void readFully(byte[] b, int off, int len) throws IOException
- Specified by:
readFully
in interfaceDataInput
- Throws:
IOException
-
readInt
public int readInt() throws IOException
- Specified by:
readInt
in interfaceDataInput
- Throws:
IOException
-
readLine
@Deprecated public String readLine() throws IOException
Deprecated.Bytes are not properly converted to chars- Specified by:
readLine
in interfaceDataInput
- Throws:
IOException
- See Also:
DataInput.readLine()
-
readLong
public long readLong() throws IOException
- Specified by:
readLong
in interfaceDataInput
- Throws:
IOException
-
readShort
public short readShort() throws IOException
- Specified by:
readShort
in interfaceDataInput
- Throws:
IOException
-
readUTF
public String readUTF() throws IOException
- Specified by:
readUTF
in interfaceDataInput
- Throws:
IOException
-
readUnsignedByte
public int readUnsignedByte() throws IOException
- Specified by:
readUnsignedByte
in interfaceDataInput
- Throws:
IOException
-
readUnsignedShort
public int readUnsignedShort() throws IOException
- Specified by:
readUnsignedShort
in interfaceDataInput
- Throws:
IOException
-
skipBytes
public int skipBytes(int n) throws IOException
- Specified by:
skipBytes
in interfaceDataInput
- Throws:
IOException
-
-