@Override
        protected Record readNext(long baseOffset, long baseTimestamp, int baseSequence, Long logAppendTime) {
            try {
                return doReadRecord(baseOffset, baseTimestamp, baseSequence, logAppendTime);
            } catch (IllegalArgumentException e) {
                throw new InvalidRecordException("Incorrect declared batch size, premature EOF reached", e);
            } catch (IOException e) {
                throw new KafkaException("Failed to decompress record stream", e);
            }
        }
Get an upper bound on the size of a batch with only a single record using a given key and value. This
is only an estimate because it does not take into account additional overhead from the compression
algorithm used.
clients/src/main/java/org/apache/kafka/common/record/DefaultRecordBatch.java