594 Part II: The Java Library
Method Description
void close( ) Closes the invoking stream. Further write attempts will
generate anIOException.
void flush( ) Finalizes the output state so that any buffers are cleared.
That is, it flushes the output buffers.
void write(bytebuffer[ ]) Writes an array of bytes to the invoking stream.
void write(bytebuffer[ ], intoffset,
intnumBytes)
Writes a subrange ofnumBytesbytes from the arraybuffer,
beginning atbuffer[offset].
void write(intb) Writes a single byte to the invoking stream. The byte written
is the low-order byte ofb.
void writeObject(Objectobj) Writes objectobjto the invoking stream.
TABLE 19-6 The Methods Defined byObjectOutput
Method Description
void close( ) Closes the invoking stream. Further write attempts will
generate anIOException.
void flush( ) Finalizes the output state so that any buffers are cleared.
That is, it flushes the output buffers.
void write(bytebuffer[ ]) Writes an array of bytes to the invoking stream.
void write(bytebuffer[ ], intoffset,
intnumBytes)
Writes a subrange ofnumBytesbytes from the arraybuffer,
beginning atbuffer[offset].
void write(intb) Writes a singlebyteto the invoking stream. The byte
written is the low-order byte ofb.
void writeBoolean(booleanb) Writes abooleanto the invoking stream.
void writeByte(intb) Writes abyteto the invoking stream. The byte written is
the low-order byte ofb.
void writeBytes(Stringstr) Writes the bytes representingstrto the invoking stream.
void writeChar(intc) Writes acharto the invoking stream.
void writeChars(Stringstr) Writes the characters instrto the invoking stream.
void writeDouble(doubled) Writes adoubleto the invoking stream.
void writeFloat(floatf) Writes afloatto the invoking stream.
void writeInt(inti) Writes anintto the invoking stream.
void writeLong(longl) Writes alongto the invoking stream.
final void writeObject(Objectobj) Writesobjto the invoking stream.
void writeShort(inti) Writes ashortto the invoking stream.
TABLE 19-7 Commonly Used Methods Defined byObjectOutputStream