public static FetchResponseData.PartitionData partitionResponse(int partition, Errors error) {
        return new FetchResponseData.PartitionData()
            .setPartitionIndex(partition)
            .setErrorCode(error.code())
            .setHighWatermark(FetchResponse.INVALID_HIGH_WATERMARK);
    }
Convenience method to find the size of a response.

@param version       The version of the response to use.
@param partIterator  The partition iterator.
@return              The response size in bytes.
clients/src/main/java/org/apache/kafka/common/requests/FetchResponse.java