Esempio n. 1
0
        public override int Read(byte[] buffer, int offset, int count)
        {
            if (_closed)
            {
                _exceptionPending = true;
                throw new InvalidOperationException("The stream has been closed.");
            }
            if (_needSetup)
            {
                SetupStream();
            }
            if (_LeftToRead == 0)
            {
                return(0);
            }
            int count2 = (int)((_LeftToRead > count) ? count : _LeftToRead);
            int num    = _crcStream.Read(buffer, offset, count2);

            _LeftToRead -= num;
            if (_LeftToRead == 0)
            {
                int crc = _crcStream.Crc;
                _currentEntry.VerifyCrcAfterExtract(crc);
                _inputStream.Seek(_endOfEntry, SeekOrigin.Begin);
            }
            return(num);
        }