Deprecated
This class has been deprecated with no replacement, because serialization can be a security liability
ObjectOutput which is interoperable with ObjectDecoder
and ObjectDecoderInputStream.
Security: serialization can be a security liability, and should not be used without defining a list of classes that are allowed to be desirialized. Such a list can be specified with the jdk.serialFilter system property, for instance. See the serialization filtering article for more information.
| Modifier and Type | Field and Description |
|---|---|
| private final int | |
| private final DataOutputStream |
| Access | Constructor and Description |
|---|---|
| public | ObjectEncoderOutputStream(OutputStream
the out)OutputStream where the serialized form will be
written outCreates a new |
| public | ObjectEncoderOutputStream(OutputStream
the out, int OutputStream where the serialized form will be
written outthe 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. estimatedLength)Creates a new |
| Modifier and Type | Method and Description |
|---|---|
| public void | close()
Overrides java. Implements java. |
| public void | flush()
Overrides java. Implements java. |
| public final int | |
| public void | write(int
the byte b)Implements abstract java. Implements java. |
| public void | write(byte[]
the data to be written b, int the start offset in the data off, int the number of bytes that are written len)Overrides java. Implements java. |
| public void | write(byte[]
the data to be written b)Overrides java. Implements java. |
| public final void | writeBoolean(boolean
the boolean to be written. v)Implements java. boolean value to this output stream.
|
| public final void | writeByte(int
the byte value to be written. v)Implements java. v.
|
| public final void | writeBytes(String
the string of bytes to be written. s)Implements java. |
| public final void | writeChar(int
the v)char value to be written.Implements java. char value, which
is comprised of two bytes, to the
output stream.
|
| public final void | writeChars(String
the string value to be written. s)Implements java. s,
to the output stream, in order,
two bytes per character.
|
| public final void | writeDouble(double
the v)double value to be written.Implements java. double value,
which is comprised of eight bytes, to the output stream.
|
| public final void | writeFloat(float
the v)float value to be written.Implements java. float value,
which is comprised of four bytes, to the output stream.
|
| public final void | writeInt(int
the v)int value to be written.Implements java. int value, which is
comprised of four bytes, to the output stream.
|
| public final void | writeLong(long
the v)long value to be written.Implements java. long value, which is
comprised of eight bytes, to the output stream.
|
| public void | writeObject(Object
the object to be written obj)Implements java. |
| public final void | writeShort(int
the v)short value to be written.Implements java. |
| public final void | writeUTF(String
the string value to be written. str)Implements java. s.
|
| estimatedLength | back to summary |
|---|---|
| private final int estimatedLength | |
| out | back to summary |
|---|---|
| private final DataOutputStream out | |
| ObjectEncoderOutputStream | back to summary |
|---|---|
| public ObjectEncoderOutputStream(OutputStream out) Creates a new
| |
| ObjectEncoderOutputStream | back to summary |
|---|---|
| public ObjectEncoderOutputStream(OutputStream out, int estimatedLength) Creates a new
| |
| close | back to summary |
|---|---|
| public void close() throws IOException Overrides java. Implements java. Doc from java. Closes the stream. This method must be called to release any resources associated with the stream.
| |
| flush | back to summary |
|---|---|
| public void flush() throws IOException Overrides java. Implements java. Doc from java. Flushes the stream. This will write any buffered output bytes.
| |
| size | back to summary |
|---|---|
| public final int size() | |
| write | back to summary |
|---|---|
| public void write(int b) throws IOException Implements abstract java. Implements java. Doc from java. Writes a byte. This method will block until the byte is actually written.
| |
| write | back to summary |
|---|---|
| public void write(byte[] b, int off, int len) throws IOException Overrides java. Implements java. Doc from java. Writes a sub array of bytes.
| |
| write | back to summary |
|---|---|
| public void write(byte[] b) throws IOException Overrides java. Implements java. Doc from java. Writes an array of bytes. This method will block until the bytes are actually written.
| |
| writeBoolean | back to summary |
|---|---|
| public final void writeBoolean(boolean v) throws IOException Implements java. Doc from java. Writes a
| |
| writeByte | back to summary |
|---|---|
| public final void writeByte(int v) throws IOException Implements java. Doc from java. Writes to the output stream the eight low-order
bits of the argument
| |
| writeBytes | back to summary |
|---|---|
| public final void writeBytes(String s) throws IOException Implements java. Doc from java. Writes a string to the output stream.
For every character in the string
If
| |
| writeChar | back to summary |
|---|---|
| public final void writeChar(int v) throws IOException Implements java. Doc from java. Writes a
The bytes written by this method may be
read by the
| |
| writeChars | back to summary |
|---|---|
| public final void writeChars(String s) throws IOException Implements java. Doc from java. Writes every character in the string
| |
| writeDouble | back to summary |
|---|---|
| public final void writeDouble(double v) throws IOException Implements java. Doc from java. Writes a
| |
| writeFloat | back to summary |
|---|---|
| public final void writeFloat(float v) throws IOException Implements java. Doc from java. Writes a
| |
| writeInt | back to summary |
|---|---|
| public final void writeInt(int v) throws IOException Implements java. Doc from java. Writes an
The bytes written by this method may be read
by the
| |
| writeLong | back to summary |
|---|---|
| public final void writeLong(long v) throws IOException Implements java. Doc from java. Writes a
The bytes written by this method may be
read by the
| |
| writeObject | back to summary |
|---|---|
| public void writeObject(Object obj) throws IOException Implements java. Doc from java. Write an object to the underlying storage or stream. The class that implements this interface defines how the object is written.
| |
| writeShort | back to summary |
|---|---|
| public final void writeShort(int v) throws IOException Implements java. Doc from java. Writes two bytes to the output stream to represent the value of the argument. The byte values to be written, in the order shown, are:
The bytes written by this method may be
read by the
| |
| writeUTF | back to summary |
|---|---|
| public final void writeUTF(String str) throws IOException Implements java. Doc from java. Writes two bytes of length information
to the output stream, followed
by the
modified UTF-8
representation
of every character in the string
If a character (byte)c
If a character If a character
First,
the total number of bytes needed to represent
all the characters of The
bytes written by this method may be read
by the
| |