public class ObjectEncoderOutputStream
extends java.io.OutputStream
implements java.io.ObjectOutput
Constructor and Description |
---|
ObjectEncoderOutputStream(java.io.OutputStream out)
Creates a new
ObjectOutput with the estimated length of 512
bytes. |
ObjectEncoderOutputStream(java.io.OutputStream out,
int estimatedLength)
Creates a new
ObjectOutput . |
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
flush() |
int |
size() |
void |
write(byte[] b) |
void |
write(byte[] b,
int off,
int len) |
void |
write(int b) |
void |
writeBoolean(boolean v) |
void |
writeByte(int v) |
void |
writeBytes(java.lang.String s) |
void |
writeChar(int v) |
void |
writeChars(java.lang.String s) |
void |
writeDouble(double v) |
void |
writeFloat(float v) |
void |
writeInt(int v) |
void |
writeLong(long v) |
void |
writeObject(java.lang.Object obj) |
void |
writeShort(int v) |
void |
writeUTF(java.lang.String str) |
public ObjectEncoderOutputStream(java.io.OutputStream out)
ObjectOutput
with the estimated length of 512
bytes.out
- the OutputStream
where the serialized form will be
written outpublic ObjectEncoderOutputStream(java.io.OutputStream out, int estimatedLength)
ObjectOutput
.out
- the OutputStream
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.public void writeObject(java.lang.Object obj) throws java.io.IOException
writeObject
in interface java.io.ObjectOutput
java.io.IOException
public void write(int b) throws java.io.IOException
write
in interface java.io.DataOutput
write
in interface java.io.ObjectOutput
write
in class java.io.OutputStream
java.io.IOException
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.io.ObjectOutput
close
in interface java.lang.AutoCloseable
close
in class java.io.OutputStream
java.io.IOException
public void flush() throws java.io.IOException
flush
in interface java.io.Flushable
flush
in interface java.io.ObjectOutput
flush
in class java.io.OutputStream
java.io.IOException
public final int size()
public void write(byte[] b, int off, int len) throws java.io.IOException
write
in interface java.io.DataOutput
write
in interface java.io.ObjectOutput
write
in class java.io.OutputStream
java.io.IOException
public void write(byte[] b) throws java.io.IOException
write
in interface java.io.DataOutput
write
in interface java.io.ObjectOutput
write
in class java.io.OutputStream
java.io.IOException
public final void writeBoolean(boolean v) throws java.io.IOException
writeBoolean
in interface java.io.DataOutput
java.io.IOException
public final void writeByte(int v) throws java.io.IOException
writeByte
in interface java.io.DataOutput
java.io.IOException
public final void writeBytes(java.lang.String s) throws java.io.IOException
writeBytes
in interface java.io.DataOutput
java.io.IOException
public final void writeChar(int v) throws java.io.IOException
writeChar
in interface java.io.DataOutput
java.io.IOException
public final void writeChars(java.lang.String s) throws java.io.IOException
writeChars
in interface java.io.DataOutput
java.io.IOException
public final void writeDouble(double v) throws java.io.IOException
writeDouble
in interface java.io.DataOutput
java.io.IOException
public final void writeFloat(float v) throws java.io.IOException
writeFloat
in interface java.io.DataOutput
java.io.IOException
public final void writeInt(int v) throws java.io.IOException
writeInt
in interface java.io.DataOutput
java.io.IOException
public final void writeLong(long v) throws java.io.IOException
writeLong
in interface java.io.DataOutput
java.io.IOException
public final void writeShort(int v) throws java.io.IOException
writeShort
in interface java.io.DataOutput
java.io.IOException
public final void writeUTF(java.lang.String str) throws java.io.IOException
writeUTF
in interface java.io.DataOutput
java.io.IOException
Copyright © 2008–2018 The Netty Project. All rights reserved.