Lucene.Net.Codecs.CodecUtil.CheckFooter C# (CSharp) Метод

CheckFooter() публичный статический Метод

Validates the codec footer previously written by #writeFooter.
if the footer is invalid, if the checksum does not match, /// or if {@code in} is not properly positioned before the footer /// at the end of the stream.
public static CheckFooter ( Lucene.Net.Store.ChecksumIndexInput @in ) : long
@in Lucene.Net.Store.ChecksumIndexInput
Результат long
        public static long CheckFooter(ChecksumIndexInput @in)
        {
            ValidateFooter(@in);
            long actualChecksum = @in.Checksum;
            long expectedChecksum = @in.ReadLong();
            if (expectedChecksum != actualChecksum)
            {
                throw new Exception("checksum failed (hardware problem?) : expected=" + expectedChecksum.ToString("x") + " actual=" + actualChecksum.ToString("x") + " (resource=" + @in + ")");
            }
            if (@in.FilePointer != @in.Length())
            {
                throw new Exception("did not read all bytes from file: read " + @in.FilePointer + " vs size " + @in.Length() + " (resource: " + @in + ")");
            }
            return actualChecksum;
        }