@Override
        protected int headerSize() {
            return LOG_OVERHEAD + LegacyRecord.headerSize(magic);
        }
LegacyRecordBatch does not implement this iterator and would hence fallback to the normal iterator.

@return An iterator over the records contained within this batch
clients/src/main/java/org/apache/kafka/common/record/AbstractLegacyRecordBatch.java