Class ObjectEncoderOutputStream
java.lang.Object
java.io.OutputStream
org.jboss.netty.handler.codec.serialization.ObjectEncoderOutputStream
- All Implemented Interfaces:
Closeable, DataOutput, Flushable, ObjectOutput, AutoCloseable
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreates a newObjectOutputwith the estimated length of 512 bytes.ObjectEncoderOutputStream(OutputStream out, int estimatedLength) Creates a newObjectOutput. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidflush()final intsize()voidwrite(byte[] b) voidwrite(byte[] b, int off, int len) voidwrite(int b) final voidwriteBoolean(boolean v) final voidwriteByte(int v) final voidwriteBytes(String s) final voidwriteChar(int v) final voidwriteChars(String s) final voidwriteDouble(double v) final voidwriteFloat(float v) final voidwriteInt(int v) final voidwriteLong(long v) voidwriteObject(Object obj) final voidwriteShort(int v) final void
-
Field Details
-
out
-
estimatedLength
private final int estimatedLength
-
-
Constructor Details
-
ObjectEncoderOutputStream
Creates a newObjectOutputwith the estimated length of 512 bytes.- Parameters:
out- theOutputStreamwhere the serialized form will be written out
-
ObjectEncoderOutputStream
Creates a newObjectOutput.- Parameters:
out- theOutputStreamwhere the serialized form will be written outestimatedLength- the estimated byte length of the serialized form of an object. If the length of the serialized form exceeds this value, the internal buffer will be expanded automatically at the cost of memory bandwidth. If this value is too big, it will also waste memory bandwidth. To avoid unnecessary memory copy or allocation cost, please specify the properly estimated value.
-
-
Method Details
-
writeObject
- Specified by:
writeObjectin interfaceObjectOutput- Throws:
IOException
-
write
- Specified by:
writein interfaceDataOutput- Specified by:
writein interfaceObjectOutput- Specified by:
writein classOutputStream- Throws:
IOException
-
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
-
size
public final int size() -
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
-
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
-