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 newObjectOutput
with the estimated length of 512 bytes.ObjectEncoderOutputStream
(OutputStream out, int estimatedLength) Creates a newObjectOutput
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
void
flush()
final int
size()
void
write
(byte[] b) void
write
(byte[] b, int off, int len) void
write
(int b) final void
writeBoolean
(boolean v) final void
writeByte
(int v) final void
writeBytes
(String s) final void
writeChar
(int v) final void
writeChars
(String s) final void
writeDouble
(double v) final void
writeFloat
(float v) final void
writeInt
(int v) final void
writeLong
(long v) void
writeObject
(Object obj) final void
writeShort
(int v) final void
-
Field Details
-
out
-
estimatedLength
private final int estimatedLength
-
-
Constructor Details
-
ObjectEncoderOutputStream
Creates a newObjectOutput
with the estimated length of 512 bytes.- Parameters:
out
- theOutputStream
where the serialized form will be written out
-
ObjectEncoderOutputStream
Creates a newObjectOutput
.- Parameters:
out
- theOutputStream
where 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:
writeObject
in interfaceObjectOutput
- Throws:
IOException
-
write
- Specified by:
write
in interfaceDataOutput
- Specified by:
write
in interfaceObjectOutput
- Specified by:
write
in classOutputStream
- Throws:
IOException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceObjectOutput
- Overrides:
close
in classOutputStream
- Throws:
IOException
-
flush
- Specified by:
flush
in interfaceFlushable
- Specified by:
flush
in interfaceObjectOutput
- Overrides:
flush
in classOutputStream
- Throws:
IOException
-
size
public final int size() -
write
- Specified by:
write
in interfaceDataOutput
- Specified by:
write
in interfaceObjectOutput
- Overrides:
write
in classOutputStream
- Throws:
IOException
-
write
- Specified by:
write
in interfaceDataOutput
- Specified by:
write
in interfaceObjectOutput
- Overrides:
write
in classOutputStream
- Throws:
IOException
-
writeBoolean
- Specified by:
writeBoolean
in interfaceDataOutput
- Throws:
IOException
-
writeByte
- Specified by:
writeByte
in interfaceDataOutput
- Throws:
IOException
-
writeBytes
- Specified by:
writeBytes
in interfaceDataOutput
- Throws:
IOException
-
writeChar
- Specified by:
writeChar
in interfaceDataOutput
- Throws:
IOException
-
writeChars
- Specified by:
writeChars
in interfaceDataOutput
- Throws:
IOException
-
writeDouble
- Specified by:
writeDouble
in interfaceDataOutput
- Throws:
IOException
-
writeFloat
- Specified by:
writeFloat
in interfaceDataOutput
- Throws:
IOException
-
writeInt
- Specified by:
writeInt
in interfaceDataOutput
- Throws:
IOException
-
writeLong
- Specified by:
writeLong
in interfaceDataOutput
- Throws:
IOException
-
writeShort
- Specified by:
writeShort
in interfaceDataOutput
- Throws:
IOException
-
writeUTF
- Specified by:
writeUTF
in interfaceDataOutput
- Throws:
IOException
-