If the stream
s is not already closed, close it and return
Before closing any buffered bytes or characters are flushed to the underlying stream if
the stream is a writer. Once a stream is closed, no more input or output operations may be performed on it.
Because the operating system may place limits on the number of file streams open at one time
or restrict access to an open file, it is good practice to close any file stream that will
no longer be used for input or output. Closing a stream that has already been closed has no effect.
Closing a string or byte array stream has no effect. As they consume no system resources, string and byte array streams are safely reclaimed by the garbage collector.
Core Module Index | Contents