Class DontCloseOutputStream

java.lang.Object
java.io.OutputStream
java.io.FilterOutputStream
com.aoapps.hodgepodge.io.DontCloseOutputStream
All Implemented Interfaces:
NoClose, Closeable, Flushable, AutoCloseable

@Deprecated(forRemoval=true) public class DontCloseOutputStream extends FilterOutputStream implements NoClose
Deprecated, for removal: This API element is subject to removal in a future version.
Please use NoCloseOutputStream instead
Wraps an OutputStream to protect it from close calls. This is useful for at least GZIPOutputStream where the native resources of the GZIPOutputStream need to be released using the close call while the underlying stream is left intact.
Author:
AO Industries, Inc.
  • Constructor Details

    • DontCloseOutputStream

      public DontCloseOutputStream(OutputStream out)
      Deprecated, for removal: This API element is subject to removal in a future version.
  • Method Details

    • write

      public void write(byte[] b, int off, int len) throws IOException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      write in class FilterOutputStream
      Throws:
      IOException
    • close

      public void close()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Does nothing on close to protect the wrapped OutputStream.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Specified by:
      close in interface NoClose
      Overrides:
      close in class FilterOutputStream