if (isChecksum()) {
long expectedChecksum = buffer.getLong();
byte data[] = new byte[buffer.remaining()];
Checksum checksum = new Adler32();
buffer.get(data);
checksum.update(data, 0, data.length);
if (expectedChecksum != checksum.getValue()) {
throw new IOException("Bad checksum for location: " + location);
}
}
Location next = goToNextLocation(location, Location.BATCH_CONTROL_RECORD_TYPE, true);