Class InterceptingOutputStream
java.lang.Object
java.io.OutputStream
org.glassfish.jersey.jdk.connector.internal.InterceptingOutputStream
- All Implemented Interfaces:
Closeable
,Flushable
,AutoCloseable
A stream that invokes
InterceptingOutputStream.FirstCallListener
when any operation is invoked.
InterceptingOutputStream.FirstCallListener
is invoked only once in the stream lifetime.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static interface
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final InterceptingOutputStream.FirstCallListener
private boolean
private final OutputStream
-
Constructor Summary
ConstructorsConstructorDescriptionInterceptingOutputStream
(OutputStream wrappedStream, InterceptingOutputStream.FirstCallListener firstCallListener) -
Method Summary
Methods inherited from class java.io.OutputStream
nullOutputStream
-
Field Details
-
wrappedStream
-
firstCallListener
-
listenerInvoked
private volatile boolean listenerInvoked
-
-
Constructor Details
-
InterceptingOutputStream
InterceptingOutputStream(OutputStream wrappedStream, InterceptingOutputStream.FirstCallListener firstCallListener)
-
-
Method Details
-
write
- Overrides:
write
in classOutputStream
- Throws:
IOException
-
write
- Overrides:
write
in classOutputStream
- Throws:
IOException
-
flush
- Specified by:
flush
in interfaceFlushable
- Overrides:
flush
in classOutputStream
- Throws:
IOException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classOutputStream
- Throws:
IOException
-
write
- Specified by:
write
in classOutputStream
- Throws:
IOException
-
tryInvokingListener
private void tryInvokingListener()
-