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

class BufferedBodyOutputStream extends BodyOutputStream
  • Field Details

  • Constructor Details

    • BufferedBodyOutputStream

      BufferedBodyOutputStream()
  • Method Details

    • setWriteListener

      public void setWriteListener(WriteListener writeListener)
      Description copied from class: BodyOutputStream
      Instructs the stream to invoke the provided WriteListener when it is possible to write.

      If the stream is in UNDECIDED state, invoking this method will commit the stream to ASYNCHRONOUS mode.

      Specified by:
      setWriteListener in class BodyOutputStream
      Parameters:
      writeListener - the WriteListener that should be notified when it's possible to write.
    • isReady

      public boolean isReady()
      Description copied from class: BodyOutputStream
      Returns 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, an IllegalStateException is thrown.

      Specified by:
      isReady in class BodyOutputStream
      Returns:
      true if data can be obtained without blocking, otherwise returns false.
    • write

      public void write(int b) throws IOException
      Specified by:
      write in class OutputStream
      Throws:
      IOException
    • toBuffer

      ByteBuffer toBuffer()