code: public void addMessage(Object msg, int size, ChannelPromise promise) {
          Entry entry = Entry.newInstance(msg, size, total(msg), promise);
          if (tailEntry == null) {
              flushedEntry = null;
          } else {
              Entry tail = tailEntry;
              tail.next = entry;
          }
          tailEntry = entry;
          if (unflushedEntry == null) {
              unflushedEntry = entry;
          }
  
          // increment pending bytes after adding message to the unflushed arrays.
          // See https://github.com/netty/netty/issues/1619
          incrementPendingOutboundBytes(entry.pendingSize, false);
      }
docs: Add given message to this {@link ChannelOutboundBuffer}. The given {@link ChannelPromise} will be notified once
  the message was written.