/// <summary>
/// Like {@link
/// #checkHeader(DataInput,String,int,int)} except this
/// version assumes the first int has already been read
/// and validated from the input.
/// </summary>
public static int CheckHeaderNoMagic(DataInput @in, string codec, int minVersion, int maxVersion)
{
string actualCodec = @in.ReadString();
if (!actualCodec.Equals(codec))
{
throw new System.IO.IOException("codec mismatch: actual codec=" + actualCodec + " vs expected codec=" + codec + " (resource: " + @in + ")");
}
int actualVersion = @in.ReadInt();
if (actualVersion < minVersion)
{
throw new System.IO.IOException("Version: " + actualVersion + " is not supported. Minimum Version number is " + minVersion + ".");
}
if (actualVersion > maxVersion)
{
throw new System.IO.IOException("Version: " + actualVersion + " is not supported. Maximum Version number is " + maxVersion + ".");
}
return actualVersion;
}