Interface NoClose

All Superinterfaces:
AutoCloseable, Closeable
All Known Implementing Classes:
AppendableWriter, EncoderWriter, FailOnWriteWriter, NoCloseInputStream, NoCloseOutputStream, NoCloseReader, NoCloseWriter, NullOutputStream, NullPrintWriter, NullWriter, WriterFacade, WriterOutputStream

public interface NoClose extends Closeable
Indicates that close() is overridden to be a no-op. This facilitates avoiding duplicate wrapping for close protection.
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Calls to close are ignored when isNoClose(), otherwise some action might be taken which means close calls to this object may not be skipped or assumed to be ignored.
    default boolean
    Determines if calls to close() will be ignored.
  • Method Details

    • isNoClose

      default boolean isNoClose()
      Determines if calls to close() will be ignored. This value must not change over time; it may be queried once, repeatedly, or never.
    • close

      void close() throws IOException
      Calls to close are ignored when isNoClose(), otherwise some action might be taken which means close calls to this object may not be skipped or assumed to be ignored.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Throws:
      IOException