checkHeader
Reads and validates a header previously written with .writeHeader.
When reading a file, supply the expected codec and an expected version range ( minVersion to maxVersion).
Return
The actual version found, when a valid header is found that matches codec, with an actual version where minVersion <= actual <= maxVersion. 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.
See also
.writeHeader
Throws
If the first four bytes are not .CODEC_MAGIC, or if the actual codec found is not codec.
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.