Class IgnoreCloseOutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- java.io.FilterOutputStream
-
- java.io.BufferedOutputStream
-
- com.cloudbees.jenkins.support.util.IgnoreCloseOutputStream
-
- All Implemented Interfaces:
WrapperOutputStream
,Closeable
,Flushable
,AutoCloseable
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public final class IgnoreCloseOutputStream extends BufferedOutputStream implements WrapperOutputStream
Provides aBufferedOutputStream
that ignores calls to close its underlying stream and instead simply flushes it.- Since:
- TODO
-
-
Field Summary
-
Fields inherited from class java.io.BufferedOutputStream
buf, count
-
Fields inherited from class java.io.FilterOutputStream
out
-
-
Constructor Summary
Constructors Constructor Description IgnoreCloseOutputStream(OutputStream out)
The underlying output stream to be filtered.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
OutputStream
unwrap()
Unwraps this stream, potentially forcing unwritten data to be flushed.-
Methods inherited from class java.io.BufferedOutputStream
flush, write, write
-
Methods inherited from class java.io.FilterOutputStream
write
-
Methods inherited from class java.io.OutputStream
nullOutputStream
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.cloudbees.jenkins.support.util.WrapperOutputStream
unwrapRecursively
-
-
-
-
Constructor Detail
-
IgnoreCloseOutputStream
public IgnoreCloseOutputStream(@NonNull OutputStream out)
The underlying output stream to be filtered.- Parameters:
out
- the underlying output stream.
-
-
Method Detail
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classFilterOutputStream
- Throws:
IOException
-
unwrap
@NonNull public OutputStream unwrap()
Description copied from interface:WrapperOutputStream
Unwraps this stream, potentially forcing unwritten data to be flushed.- Specified by:
unwrap
in interfaceWrapperOutputStream
- Returns:
- the underlying stream being wrapped
-
-