class InterceptingOutputStream
extends java.io.OutputStream
InterceptingOutputStream.FirstCallListener
when any operation is invoked.
InterceptingOutputStream.FirstCallListener
is invoked only once in the stream lifetime.Modifier and Type | Class and Description |
---|---|
(package private) static interface |
InterceptingOutputStream.FirstCallListener |
Modifier and Type | Field and Description |
---|---|
private InterceptingOutputStream.FirstCallListener |
firstCallListener |
private boolean |
listenerInvoked |
private java.io.OutputStream |
wrappedStream |
Constructor and Description |
---|
InterceptingOutputStream(java.io.OutputStream wrappedStream,
InterceptingOutputStream.FirstCallListener firstCallListener) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
flush() |
private void |
tryInvokingListener() |
void |
write(byte[] b) |
void |
write(byte[] b,
int off,
int len) |
void |
write(int b) |
private final java.io.OutputStream wrappedStream
private final InterceptingOutputStream.FirstCallListener firstCallListener
private volatile boolean listenerInvoked
InterceptingOutputStream(java.io.OutputStream wrappedStream, InterceptingOutputStream.FirstCallListener firstCallListener)
public void write(byte[] b) throws java.io.IOException
write
in class java.io.OutputStream
java.io.IOException
public void write(byte[] b, int off, int len) throws java.io.IOException
write
in class java.io.OutputStream
java.io.IOException
public void flush() throws java.io.IOException
flush
in interface java.io.Flushable
flush
in class java.io.OutputStream
java.io.IOException
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.OutputStream
java.io.IOException
public void write(int b) throws java.io.IOException
write
in class java.io.OutputStream
java.io.IOException
private void tryInvokingListener()