public void write(ByteBuffer buf) throws InterruptedException {
        try {
            FutureCompletion future = new FutureCompletion();
            channel.write(buf, future);
            future.get();
        } catch (ExecutionException e) {
            Throwable t = e.getCause();
            if (t instanceof RuntimeException) {
                throw (RuntimeException)t;
            }
            if (t instanceof Error) {
                throw (Error)t;
            }
            throw new RuntimeException(t);
        }
    }
Writes to the underlying {@link ContentChannel} and waits for the operation to complete.

@param buf The ByteBuffer to write.
@throws InterruptedException If the thread was interrupted while waiting.
@throws RuntimeException     If the operation failed to complete, see cause for details.
jdisc_core/src/main/java/com/yahoo/jdisc/handler/BlockingContentWriter.java