Class ReleasableInputStream

  • All Implemented Interfaces:
    Closeable, AutoCloseable, Releasable
    Direct Known Subclasses:
    ResettableInputStream

    @NotThreadSafe
    public class ReleasableInputStream
    extends SdkFilterInputStream
    An input stream that can have the close operation disabled (to avoid accidentally being closed). This is necessary, for example, when an input stream needs to be marked-and-reset multiple times but only as long as the input stream has not been closed. To survive not being accidentally closed, the close method can be disabled via disableClose().

    The creator of this input stream should therefore always call release() in a finally block to truly release the underlying resources.

    See Also:
    Releasable, ResettableInputStream