code: public final void add(ByteBuf buf, ChannelFutureListener listener) {
          // buffers are added before promises so that we naturally 'consume' the entire buffer during removal
          // before we complete it's promise.
          bufAndListenerPairs.add(buf);
          if (listener != null) {
              bufAndListenerPairs.add(listener);
          }
          incrementReadableBytes(buf.readableBytes());
      }
docs: Add a buffer to the end of the queue and associate a listener with it that should be completed when
  all the buffers  bytes have been consumed from the queue and written.
  @param buf to add to the tail of the queue
  @param listener to notify when all the bytes have been consumed and written, can be {@code null}.