code: @Override
    public void close() {
      if (!isClosed()) {
        closed = true;
        // With the current code we don't expect readableBytes > 0 to be possible here, added
        // defensively to prevent buffer leak issues if the framer code changes later.
        if (buffer != null && buffer.readableBytes() == 0) {
          releaseBuffer();
        }
        commitToSink(true, true);
      }
    }
docs: Flushes and closes the framer and releases any buffers. After the framer is closed or
  disposed, additional calls to this method will have no affect.