Calculate() static private méthode

Caclulate the CRC (Cyclic Reduncancy Check) for a buffer of bytes See RFC1952 for details.
static private Calculate ( byte buffer ) : uint
buffer byte The byte buffer.
Résultat uint
        /// <summary>
        /// Validate the data.
        /// </summary>
        internal void Validate()
        {
            Stream readStream = OpenRead();
            uint   crc        = 0;

            byte[] buffer = new byte[655536];
            for (;;)
            {
                int count = readStream.Read(buffer, 0, buffer.Length);
                if (count == 0)
                {
                    break;
                }
                crc = Crc32.Calculate(crc, buffer, 0, count);
            }

            readStream.Close();

            if (crc != CheckSum)
            {
                throw new InvalidOperationException("Error: data checksum failed for " + Name);
            }
        }