docs: private static ByteBuf allocateBuffer(
  			ByteBufAllocator allocator,
  			byte id,
  			int messageHeaderLength,
  			int contentLength,
  			boolean allocateForContent) {
  		checkArgument(contentLength <= Integer.MAX_VALUE - FRAME_HEADER_LENGTH);
  
  		final ByteBuf buffer;
  		if (!allocateForContent) {
  			buffer = allocator.directBuffer(FRAME_HEADER_LENGTH + messageHeaderLength);
  		} else if (contentLength != -1) {
  			buffer = allocator.directBuffer(FRAME_HEADER_LENGTH + messageHeaderLength + contentLength);
  		} else {
  			// content length unknown -> start with the default initial size (rather than FRAME_HEADER_LENGTH only):
  			buffer = allocator.directBuffer();
  		}
  		buffer.writeInt(FRAME_HEADER_LENGTH + messageHeaderLength + contentLength); // may be updated later, e.g. if contentLength == -1
  		buffer.writeInt(MAGIC_NUMBER);
  		buffer.writeByte(id);
  
  		return buffer;
  	}