Exemplo n.º 1
0
        private Int32 FigureCrc32()
        {
            if (_crcCalculated == false)
            {
                Stream input = null;
                // get the original stream:
                if (_sourceStream != null)
                {
                    _sourceStream.Position = 0;
                    input = _sourceStream;
                }
                else
                {
                    input = System.IO.File.OpenRead(LocalFileName);
                }
                var crc32 = new CRC32();

                _Crc32 = crc32.GetCrc32(input);
                if (_sourceStream == null)
                {
                    input.Close();
                    input.Dispose();
                }
                _crcCalculated = true;
            }
            return _Crc32;
        }