public int read(byte[] dst, int pos, int cnt) throws IOException {try {int n = 0;while (n < cnt) {int r = inf.inflate(dst, pos + n, cnt - n);n += r;if (inf.finished())break;if (inf.needsInput()) {onObjectData(src, buf, p, bAvail);use(bAvail);p = fill(src, 1);inf.setInput(buf, p, bAvail);} else if (r == 0) {throw new CorruptObjectException(MessageFormat.format(JGitText.get().packfileCorruptionDetected,JGitText.get().unknownZlibError));}}actualSize += n;return 0 < n ? n : -1;} catch (DataFormatException dfe) {throw new CorruptObjectException(MessageFormat.format(JGitText.get().packfileCorruptionDetected, dfe.getMessage()));}}

public override int Read(byte[] dst, int pos, int cnt){try{int n = 0;while (n < cnt){int r = this.inf.Inflate(dst, pos + n, cnt - n);if (r == 0){if (this.inf.IsFinished){break;}if (this.inf.IsNeedingInput){this._enclosing.OnObjectData(this.src, this._enclosing.buf, this.p, this._enclosing.bAvail);this._enclosing.Use(this._enclosing.bAvail);this.p = this._enclosing.Fill(this.src, 1);this.inf.SetInput(this._enclosing.buf, this.p, this._enclosing.bAvail);}else{throw new CorruptObjectException(MessageFormat.Format(JGitText.Get().packfileCorruptionDetected, JGitText.Get().unknownZlibError));}}else{n += r;}}this.actualSize += n;return 0 < n ? n : -1;}catch (SharpZipBaseException dfe){throw new CorruptObjectException(MessageFormat.Format(JGitText.Get().packfileCorruptionDetected, dfe.Message));}}
