Package com.aoindustries.io
Class DontCloseOutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- java.io.FilterOutputStream
-
- com.aoindustries.io.DontCloseOutputStream
-
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable
public class DontCloseOutputStream extends FilterOutputStream
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.
-
-
Field Summary
-
Fields inherited from class java.io.FilterOutputStream
out
-
-
Constructor Summary
Constructors Constructor Description DontCloseOutputStream(OutputStream out)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Does nothing on close to protect the wrapped OutputStream.-
Methods inherited from class java.io.FilterOutputStream
flush, write, write, write
-
-
-
-
Constructor Detail
-
DontCloseOutputStream
public DontCloseOutputStream(OutputStream out)
-
-
Method Detail
-
close
public void close()
Does nothing on close to protect the wrapped OutputStream.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classFilterOutputStream
-
-