Class ObjectSerializationOutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- org.apache.mina.filter.codec.serialization.ObjectSerializationOutputStream
-
- All Implemented Interfaces:
Closeable,DataOutput,Flushable,ObjectOutput,AutoCloseable
public class ObjectSerializationOutputStream extends OutputStream implements ObjectOutput
AnObjectOutputandOutputStreamthat can write the objects as the serialized form thatObjectSerializationDecodercan decode.- Author:
- Apache MINA Project
-
-
Constructor Summary
Constructors Constructor Description ObjectSerializationOutputStream(OutputStream out)Create a new instance of an ObjectSerializationOutputStream
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voidflush()intgetMaxObjectSize()voidsetMaxObjectSize(int maxObjectSize)Sets the allowed maximum size of the encoded object.voidwrite(byte[] b)voidwrite(byte[] b, int off, int len)voidwrite(int b)voidwriteBoolean(boolean v)voidwriteByte(int v)voidwriteBytes(String s)voidwriteChar(int v)voidwriteChars(String s)voidwriteDouble(double v)voidwriteFloat(float v)voidwriteInt(int v)voidwriteLong(long v)voidwriteObject(Object obj)voidwriteShort(int v)voidwriteUTF(String str)-
Methods inherited from class java.io.OutputStream
nullOutputStream
-
-
-
-
Constructor Detail
-
ObjectSerializationOutputStream
public ObjectSerializationOutputStream(OutputStream out)
Create a new instance of an ObjectSerializationOutputStream- Parameters:
out- TheOutputStreamto use
-
-
Method Detail
-
getMaxObjectSize
public int getMaxObjectSize()
- Returns:
- the allowed maximum size of the encoded object.
If the size of the encoded object exceeds this value, this encoder
will throw a
IllegalArgumentException. The default value isInteger.MAX_VALUE.
-
setMaxObjectSize
public void setMaxObjectSize(int maxObjectSize)
Sets the allowed maximum size of the encoded object. If the size of the encoded object exceeds this value, this encoder will throw aIllegalArgumentException. The default value isInteger.MAX_VALUE.- Parameters:
maxObjectSize- The maximum object size
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceObjectOutput- Overrides:
closein classOutputStream- Throws:
IOException
-
flush
public void flush() throws IOException- Specified by:
flushin interfaceFlushable- Specified by:
flushin interfaceObjectOutput- Overrides:
flushin classOutputStream- Throws:
IOException
-
write
public void write(int b) throws IOException- Specified by:
writein interfaceDataOutput- Specified by:
writein interfaceObjectOutput- Specified by:
writein classOutputStream- Throws:
IOException
-
write
public void write(byte[] b) throws IOException- Specified by:
writein interfaceDataOutput- Specified by:
writein interfaceObjectOutput- Overrides:
writein classOutputStream- Throws:
IOException
-
write
public void write(byte[] b, int off, int len) throws IOException- Specified by:
writein interfaceDataOutput- Specified by:
writein interfaceObjectOutput- Overrides:
writein classOutputStream- Throws:
IOException
-
writeObject
public void writeObject(Object obj) throws IOException
- Specified by:
writeObjectin interfaceObjectOutput- Throws:
IOException
-
writeBoolean
public void writeBoolean(boolean v) throws IOException- Specified by:
writeBooleanin interfaceDataOutput- Throws:
IOException
-
writeByte
public void writeByte(int v) throws IOException- Specified by:
writeBytein interfaceDataOutput- Throws:
IOException
-
writeBytes
public void writeBytes(String s) throws IOException
- Specified by:
writeBytesin interfaceDataOutput- Throws:
IOException
-
writeChar
public void writeChar(int v) throws IOException- Specified by:
writeCharin interfaceDataOutput- Throws:
IOException
-
writeChars
public void writeChars(String s) throws IOException
- Specified by:
writeCharsin interfaceDataOutput- Throws:
IOException
-
writeDouble
public void writeDouble(double v) throws IOException- Specified by:
writeDoublein interfaceDataOutput- Throws:
IOException
-
writeFloat
public void writeFloat(float v) throws IOException- Specified by:
writeFloatin interfaceDataOutput- Throws:
IOException
-
writeInt
public void writeInt(int v) throws IOException- Specified by:
writeIntin interfaceDataOutput- Throws:
IOException
-
writeLong
public void writeLong(long v) throws IOException- Specified by:
writeLongin interfaceDataOutput- Throws:
IOException
-
writeShort
public void writeShort(int v) throws IOException- Specified by:
writeShortin interfaceDataOutput- Throws:
IOException
-
writeUTF
public void writeUTF(String str) throws IOException
- Specified by:
writeUTFin interfaceDataOutput- Throws:
IOException
-
-