public override int Read(byte[] buffer, int offset, int count)
{
if (inf.IsNeedingDictionary) {
throw new SharpZipBaseException("Need a dictionary");
}
int remainingBytes = count;
while (true) {
int bytesRead = inf.Inflate(buffer, offset, remainingBytes);
offset += bytesRead;
remainingBytes -= bytesRead;
if (remainingBytes == 0 || inf.IsFinished) {
break;
}
if (inf.IsNeedingInput) {
Fill();
} else if (bytesRead == 0) {
throw new ZipException("Dont know what to do");
}
}
return count - remainingBytes;
}