Module java.base
Package java.io

Interface Closeable

    • Method Detail

      • close

        void close()    throwsIOException
        Closes this stream and releases any system resources associated with it. If the stream is already closed then invoking this method has no effect.

        As noted inAutoCloseable.close(), cases where the close may fail require careful attention. It is strongly advised to relinquish the underlying resources and to internallymark theCloseable as closed, prior to throwing theIOException.

        Specified by:
        close in interface AutoCloseable
        Throws:
        IOException - if an I/O error occurs