public void connectTo(ContentChannel content) {
        Objects.requireNonNull(content, "content");
        boolean closed;
        List<Entry> queue;
        synchronized (lock) {
            if (this.content != null || this.queue == null) {
                throw new IllegalStateException();
            }
            closed = this.closed;
            queue = this.queue;
            this.queue = null;
        }
        for (Entry entry : queue) {
            content.write(entry.buf, entry.handler);
        }
        if (closed) {
            content.close(closeCompletion);
        }
        synchronized (lock) {
            this.content = content;
            lock.notifyAll();
        }
    }
<p>Connects this BufferedContentChannel to a ContentChannel. First, this method forwards all queued calls to the
connected ContentChannel. Once this method has been called, all future calls to {@link #write(ByteBuffer,
CompletionHandler)} and {@link #close(CompletionHandler)} are synchronously forwarded to the connected
ContentChannel.</p>

@param content The ContentChannel to connect to.
@throws NullPointerException  If the <em>content</em> argument is null.
@throws IllegalStateException If another ContentChannel has already been connected.
jdisc_core/src/main/java/com/yahoo/jdisc/handler/BufferedContentChannel.java