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 intgetMaxObjectSize()intread()booleanreadBoolean()bytereadByte()charreadChar()doublereadDouble()floatreadFloat()voidreadFully(byte[] b)voidreadFully(byte[] b, int off, int len)intreadInt()StringreadLine()Deprecated.Bytes are not properly converted to charslongreadLong()ObjectreadObject()shortreadShort()intreadUnsignedByte()intreadUnsignedShort()StringreadUTF()voidsetMaxObjectSize(int maxObjectSize)Sets the allowed maximum size of the object to be decoded.intskipBytes(int n)-
Methods inherited from class java.io.InputStream
available, close, mark, markSupported, nullInputStream, read, read, readAllBytes, readNBytes, readNBytes, reset, skip, transferTo
-
-
-
-
Constructor Detail
-
ObjectSerializationInputStream
public ObjectSerializationInputStream(InputStream in)
Create a new instance of an ObjectSerializationInputStream- Parameters:
in- TheInputStreamto use
-
ObjectSerializationInputStream
public ObjectSerializationInputStream(InputStream in, ClassLoader classLoader)
Create a new instance of an ObjectSerializationInputStream- Parameters:
in- TheInputStreamto 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:
readin interfaceObjectInput- Specified by:
readin classInputStream- Throws:
IOException
-
readObject
public Object readObject() throws ClassNotFoundException, IOException
- Specified by:
readObjectin interfaceObjectInput- Throws:
ClassNotFoundExceptionIOException
-
readBoolean
public boolean readBoolean() throws IOException- Specified by:
readBooleanin interfaceDataInput- Throws:
IOException
-
readByte
public byte readByte() throws IOException- Specified by:
readBytein interfaceDataInput- Throws:
IOException
-
readChar
public char readChar() throws IOException- Specified by:
readCharin interfaceDataInput- Throws:
IOException
-
readDouble
public double readDouble() throws IOException- Specified by:
readDoublein interfaceDataInput- Throws:
IOException
-
readFloat
public float readFloat() throws IOException- Specified by:
readFloatin interfaceDataInput- Throws:
IOException
-
readFully
public void readFully(byte[] b) throws IOException- Specified by:
readFullyin interfaceDataInput- Throws:
IOException
-
readFully
public void readFully(byte[] b, int off, int len) throws IOException- Specified by:
readFullyin interfaceDataInput- Throws:
IOException
-
readInt
public int readInt() throws IOException- Specified by:
readIntin interfaceDataInput- Throws:
IOException
-
readLine
@Deprecated public String readLine() throws IOException
Deprecated.Bytes are not properly converted to chars- Specified by:
readLinein interfaceDataInput- Throws:
IOException- See Also:
DataInput.readLine()
-
readLong
public long readLong() throws IOException- Specified by:
readLongin interfaceDataInput- Throws:
IOException
-
readShort
public short readShort() throws IOException- Specified by:
readShortin interfaceDataInput- Throws:
IOException
-
readUTF
public String readUTF() throws IOException
- Specified by:
readUTFin interfaceDataInput- Throws:
IOException
-
readUnsignedByte
public int readUnsignedByte() throws IOException- Specified by:
readUnsignedBytein interfaceDataInput- Throws:
IOException
-
readUnsignedShort
public int readUnsignedShort() throws IOException- Specified by:
readUnsignedShortin interfaceDataInput- Throws:
IOException
-
skipBytes
public int skipBytes(int n) throws IOException- Specified by:
skipBytesin interfaceDataInput- Throws:
IOException
-
-