Class IsolatedOutputStream

java.lang.Object
java.io.OutputStream
org.eclipse.jgit.util.io.IsolatedOutputStream
All Implemented Interfaces:
Closeable, Flushable, AutoCloseable

public class IsolatedOutputStream extends OutputStream
OutputStream isolated from interrupts.

Wraps an OutputStream to prevent interrupts during writes from being made visible to that stream instance. This works around buggy or difficult OutputStream implementations like JSch that cannot gracefully handle an interrupt during write.

Every write (or flush) requires a context switch to another thread. Callers should wrap this stream with BufferedOutputStream using a suitable buffer size to amortize the cost of context switches.

Since:
4.6