public override int Read(byte[] buffer, int offset, int count)
{
if (rwMode != RwMode.ReadOnly)
{
_exceptionPending = true;
throw new InvalidOperationException("Stream Error: Cannot Read.");
}
int r = _innerStream.Read(buffer, offset, count);
int r1 = r;
while (r1 != count)
{
if (_innerStream.Position != _innerStream.Length)
{
_exceptionPending = true;
throw new ZipException(String.Format("Read error in file {0}", CurrentName));
}
if (CurrentSegment + 1 == _maxDiskNumber)
return r; // no more to read
CurrentSegment++;
_SetReadStream();
offset += r1;
count -= r1;
r1 = _innerStream.Read(buffer, offset, count);
r += r1;
}
return r;
}