diff --git a/src/Zip/ZipFile.cs b/src/Zip/ZipFile.cs index 6a71cae5c..5be059daf 100644 --- a/src/Zip/ZipFile.cs +++ b/src/Zip/ZipFile.cs @@ -3778,8 +3778,11 @@ public override int Read(byte[] buffer, int offset, int count) return 0; } } - - baseStream_.Seek(readPos_, SeekOrigin.Begin); + // Protect against Stream implementations that throw away their buffer on every Seek + // (for example, Mono FileStream) + if (baseStream_.Position != readPos_) { + baseStream_.Seek(readPos_, SeekOrigin.Begin); + } int readCount = baseStream_.Read(buffer, offset, count); if (readCount > 0) { readPos_ += readCount;