Class BlockingContentWriter

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()
      Closes the underlying ContentChannel and waits for the operation to complete.
      void write​(java.nio.ByteBuffer buf)
      Writes to the underlying ContentChannel and waits for the operation to complete.
      • Methods inherited from class java.lang.Object

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

      • BlockingContentWriter

        public BlockingContentWriter​(ContentChannel content)
        Creates a new BlockingContentWriter that encapsulates a given ContentChannel.
        Parameters:
        content - The ContentChannel to encapsulate.
        Throws:
        java.lang.NullPointerException - If the content argument is null.
    • Method Detail

      • write

        public void write​(java.nio.ByteBuffer buf)
                   throws java.lang.InterruptedException
        Writes to the underlying ContentChannel and waits for the operation to complete.
        Parameters:
        buf - The ByteBuffer to write.
        Throws:
        java.lang.InterruptedException - If the thread was interrupted while waiting.
        java.lang.RuntimeException - If the operation failed to complete, see cause for details.
      • close

        public void close()
                   throws java.lang.InterruptedException
        Closes the underlying ContentChannel and waits for the operation to complete.
        Throws:
        java.lang.InterruptedException - If the thread was interrupted while waiting.
        java.lang.RuntimeException - If the operation failed to complete, see cause for details.