Closes this file output stream and releases any system resources associated with this stream. This file output stream may no longer be used for writing bytes.
If this stream has an associated channel then the channel is closed as well.
IOException | if an I/O error occurs. |
@apiNote
Overriding close to perform cleanup actions is reliable
only when called directly or when called by try-with-resources.
Do not depend on finalization to invoke close;
finalization is not reliable and is deprecated.
If cleanup of native resources is needed, other mechanisms such as
java.lang.ref.Cleaner should be used.
@revised 1.4
@spec JSR-51
Writes the specified byte to this file output stream. Implements
the write method of OutputStream.
b | the byte to be written. |
IOException | if an I/O error occurs. |
Writes b.length bytes from the specified byte array
to this file output stream.
b | the data. |
IOException | if an I/O error occurs. |
Writes len bytes from the specified byte array
starting at offset off to this file output stream.
b | the data. | |
off | the start offset in the data. | |
len | the number of bytes to write. |
IOException | if an I/O error occurs. |
Diagram: OutputStream