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.FirstCallListenerprivate booleanprivate final OutputStream -
Constructor Summary
ConstructorsConstructorDescriptionInterceptingOutputStream(OutputStream wrappedStream, InterceptingOutputStream.FirstCallListener firstCallListener) -
Method Summary
Methods inherited from class OutputStream
nullOutputStream
-
Field Details
-
wrappedStream
-
firstCallListener
-
listenerInvoked
private volatile boolean listenerInvoked
-
-
Constructor Details
-
InterceptingOutputStream
InterceptingOutputStream(OutputStream wrappedStream, InterceptingOutputStream.FirstCallListener firstCallListener)
-
-
Method Details
-
write
- Overrides:
writein classOutputStream- Throws:
IOException
-
write
- Overrides:
writein classOutputStream- Throws:
IOException
-
flush
- Specified by:
flushin interfaceFlushable- Overrides:
flushin classOutputStream- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classOutputStream- Throws:
IOException
-
write
- Specified by:
writein classOutputStream- Throws:
IOException
-
tryInvokingListener
private void tryInvokingListener()
-