if (format < FORMAT_MAXIMUM) {
throw new IndexFormatTooNewException(input, format,
FORMAT_MINIMUM, FORMAT_MAXIMUM);
}
version = input.readLong(); // read version
counter = input.readInt(); // read counter
for (int i = input.readInt(); i > 0; i--) { // read segmentInfos
SegmentInfo si = new SegmentInfo(directory, format, input);
if (si.getVersion() == null) {
// It's a pre-3.1 segment, upgrade its version to either 3.0 or 2.x