Class BufferedBodyOutputStream

  • All Implemented Interfaces:
    java.io.Closeable, java.io.Flushable, java.lang.AutoCloseable

    class BufferedBodyOutputStream
    extends BodyOutputStream
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean isReady()
      Returns true if data can be written without blocking else returns false.
      void setWriteListener​(WriteListener writeListener)
      Instructs the stream to invoke the provided WriteListener when it is possible to write.
      (package private) java.nio.ByteBuffer toBuffer()  
      void write​(int b)  
      • Methods inherited from class java.io.OutputStream

        close, flush, nullOutputStream, write, write
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • BufferedBodyOutputStream

        BufferedBodyOutputStream()
    • Method Detail

      • 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 java.io.IOException
        Specified by:
        write in class java.io.OutputStream
        Throws:
        java.io.IOException
      • toBuffer

        java.nio.ByteBuffer toBuffer()