code: private ByteBuf nextBufferForFrame(int bytesToRead) {
      ByteBuf buf = buffers.getFirst();
      ByteBuf frame;
  
      if (buf.readableBytes() > bytesToRead) {
        frame = buf.retain().readSlice(bytesToRead);
        totalSize -= bytesToRead;
      } else {
        frame = buf;
        buffers.removeFirst();
        totalSize -= frame.readableBytes();
      }
  
      return frame;
    }
docs: Takes the first buffer in the internal list, and either adjust it to fit in the frame
  (by taking a slice out of it) or remove it from the internal list.