public static int sizeOf(short version,
                             Iterator<Map.Entry<TopicIdPartition, ShareFetchResponseData.PartitionData>> partIterator) {
        // Since the throttleTimeMs and metadata field sizes are constant and fixed, we can
        // use arbitrary values here without affecting the result.
        ShareFetchResponseData data = toMessage(Errors.NONE, 0, partIterator, Collections.emptyList());
        ObjectSerializationCache cache = new ObjectSerializationCache();
        return 4 + data.size(cache, version);
    }
Convenience method to find the size of a response.

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