checkIndexHeader
Reads and validates a header previously written with .writeIndexHeader.
When reading a file, supply the expected codec, expected version range (minVersion to maxVersion), and object ID and suffix.
Return
The actual version found, when a valid header is found that matches codec, with an actual version where minVersion <= actual <= maxVersion, and matching expectedID and expectedSuffix Otherwise an exception is thrown.
Parameters
Input stream, positioned at the point where the header was previously written. Typically this is located at the beginning of the file.
The expected codec name.
The minimum supported expected version number.
The maximum supported expected version number.
The expected object identifier for this file.
The expected auxiliary suffix for this file.
See also
.writeIndexHeader
Throws
If the first four bytes are not .CODEC_MAGIC, or if the actual codec found is not codec, or if the expectedID or expectedSuffix do not match.
If the actual version is less than minVersion.
If the actual version is greater than maxVersion * .
If there is an I/O error reading from the underlying medium.