org.eclipse.rdf4j.common.io

## Class UncloseableOutputStream

- java.lang.Object
- - java.io.OutputStream
  - - java.io.FilterOutputStream
    - - org.eclipse.rdf4j.common.io.UncloseableOutputStream

- All Implemented Interfaces:
    Closeable, Flushable, AutoCloseable

      public class UncloseableOutputStream
      extends FilterOutputStream

  A wrapper for an output stream to avoid allowing libraries to close output streams unexpectedly using the `close()` method. Instead, they must be closed by the creator using `doClose()`.
  Author:
    Bart Hanssens

- - ### Field Summary

    - ### Fields inherited from class java.io.FilterOutputStream

      `out`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `UncloseableOutputStream(OutputStream parent)` Constructor

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()`
    `void` | `doClose()` Invoke close on FilterOutputStream parent class.

    - ### Methods inherited from class java.io.FilterOutputStream

      `flush, write, write, write`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### UncloseableOutputStream

          public UncloseableOutputStream(OutputStream parent)

      Constructor
      Parameters:
        `parent` - output stream

  - ### Method Detail

    - #### close

          public void close()
                     throws IOException

      Specified by:
        `close` in interface `Closeable`
      Specified by:
        `close` in interface `AutoCloseable`
      Overrides:
        `close` in class `FilterOutputStream`
      Throws:
        `IOException`

    - #### doClose

          public void doClose()
                       throws IOException

      Invoke close on FilterOutputStream parent class.
      Throws:
        `IOException`

Copyright © 2015-2021 Eclipse Foundation. All Rights Reserved.