Interface NonAutoCloseable

All Superinterfaces:
AutoCloseable
All Known Implementing Classes:
NonAutoCloseableInputStream, NonAutoCloseableOutputStream, NonAutoCloseableReader, NonAutoCloseableWriter
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface NonAutoCloseable extends AutoCloseable

A wrapper for AutoCloseable which disables its AutoCloseable.close() method instead providing doClose() method for explicit closing of this object.

This may come in handy when passing AutoCloseable objects to foreign methods which may close this object although this should happen later

  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    Imitates closing this object not actually doing it.
    void
    Actually closes this object as if it was done by calling AutoCloseable.close().