The following table depicts the commonly used methods defined by ObjectOutputStream:
| Method Name | Description |
|---|---|
| void close() | Closes the invoking stream with an IOException. |
| void flush() | Flushes the output buffers. |
| void write(int b) | Writes a single byte to the invoking stream. |
| void writeChar(int c) | Writes a char to the invoking stream. |
| void write(byte buffer[]) | Writes an array of byte to the invoking stream. |
| final void writeObject(Object o) | Writes an object to the invoking stream. |
| void writeBoolean(boolean b) | Writes a boolean to the invoking stream. |
| void write(byte buffer[], int offset, int numBytes) | Writes a subrange of numBytes bytes from the array buffer. |
Responses to “What are the methods of ObjectOutputStream?”