Class ObjectSerializationOutputStream
java.lang.Object
java.io.OutputStream
org.apache.mina.filter.codec.serialization.ObjectSerializationOutputStream
- All Implemented Interfaces:
Closeable, DataOutput, Flushable, ObjectOutput, AutoCloseable
An
ObjectOutput and OutputStream that can write the objects as
the serialized form that ObjectSerializationDecoder can decode.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreate a new instance of an ObjectSerializationOutputStream -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidflush()intvoidsetMaxObjectSize(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) void
-
Field Details
-
out
-
maxObjectSize
private int maxObjectSize
-
-
Constructor Details
-
ObjectSerializationOutputStream
Create a new instance of an ObjectSerializationOutputStream- Parameters:
out- TheOutputStreamto use
-
-
Method Details
-
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
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceObjectOutput- Overrides:
closein classOutputStream- Throws:
IOException
-
flush
- Specified by:
flushin interfaceFlushable- Specified by:
flushin interfaceObjectOutput- Overrides:
flushin classOutputStream- Throws:
IOException
-
write
- Specified by:
writein interfaceDataOutput- Specified by:
writein interfaceObjectOutput- Specified by:
writein classOutputStream- Throws:
IOException
-
write
- Specified by:
writein interfaceDataOutput- Specified by:
writein interfaceObjectOutput- Overrides:
writein classOutputStream- Throws:
IOException
-
write
- Specified by:
writein interfaceDataOutput- Specified by:
writein interfaceObjectOutput- Overrides:
writein classOutputStream- Throws:
IOException
-
writeObject
- Specified by:
writeObjectin interfaceObjectOutput- Throws:
IOException
-
writeBoolean
- Specified by:
writeBooleanin interfaceDataOutput- Throws:
IOException
-
writeByte
- Specified by:
writeBytein interfaceDataOutput- Throws:
IOException
-
writeBytes
- Specified by:
writeBytesin interfaceDataOutput- Throws:
IOException
-
writeChar
- Specified by:
writeCharin interfaceDataOutput- Throws:
IOException
-
writeChars
- Specified by:
writeCharsin interfaceDataOutput- Throws:
IOException
-
writeDouble
- Specified by:
writeDoublein interfaceDataOutput- Throws:
IOException
-
writeFloat
- Specified by:
writeFloatin interfaceDataOutput- Throws:
IOException
-
writeInt
- Specified by:
writeIntin interfaceDataOutput- Throws:
IOException
-
writeLong
- Specified by:
writeLongin interfaceDataOutput- Throws:
IOException
-
writeShort
- Specified by:
writeShortin interfaceDataOutput- Throws:
IOException
-
writeUTF
- Specified by:
writeUTFin interfaceDataOutput- Throws:
IOException
-