Class BufferedBodyOutputStream
java.lang.Object
java.io.OutputStream
org.glassfish.jersey.jdk.connector.internal.BodyOutputStream
org.glassfish.jersey.jdk.connector.internal.BufferedBodyOutputStream
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ByteArrayOutputStreamprivate BufferedBodyOutputStream.Mode -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanisReady()Returns true if data can be written without blocking else returns false.voidsetWriteListener(WriteListener writeListener) Instructs the stream to invoke the providedWriteListenerwhen it is possible to write.(package private) ByteBuffertoBuffer()voidwrite(int b) Methods inherited from class java.io.OutputStream
close, flush, nullOutputStream, write, write
-
Field Details
-
buffer
-
mode
-
-
Constructor Details
-
BufferedBodyOutputStream
BufferedBodyOutputStream()
-
-
Method Details
-
setWriteListener
Description copied from class:BodyOutputStreamInstructs the stream to invoke the providedWriteListenerwhen it is possible to write. If the stream is in UNDECIDED state, invoking this method will commit the stream to ASYNCHRONOUS mode.- Specified by:
setWriteListenerin classBodyOutputStream- Parameters:
writeListener- theWriteListenerthat should be notified when it's possible to write.
-
isReady
public boolean isReady()Description copied from class:BodyOutputStreamReturns true if data can be written without blocking else returns false. If the stream is in ASYNCHRONOUS mode and the user attempts to write to it even though this method returns false, anIllegalStateExceptionis thrown.- Specified by:
isReadyin classBodyOutputStream- Returns:
trueif data can be obtained without blocking, otherwise returnsfalse.
-
write
- Specified by:
writein classOutputStream- Throws:
IOException
-
toBuffer
ByteBuffer toBuffer()
-