System.IO.Compression.SubReadStream.Read C# (CSharp) Méthode

Read() public méthode

public Read ( byte buffer, int offset, int count ) : int
buffer byte
offset int
count int
Résultat int
        public override int Read(byte[] buffer, int offset, int count)
        {
            //parameter validation sent to _superStream.Read
            int origCount = count;

            ThrowIfDisposed();
            ThrowIfCantRead();

            if (_superStream.Position != _positionInSuperStream)
                _superStream.Seek(_positionInSuperStream, SeekOrigin.Begin);
            if (_positionInSuperStream + count > _endInSuperStream)
                count = (int)(_endInSuperStream - _positionInSuperStream);

            Debug.Assert(count >= 0);
            Debug.Assert(count <= origCount);

            int ret = _superStream.Read(buffer, offset, count);

            _positionInSuperStream += ret;
            return ret;
        }