Ruby runtime = getRuntime();
// MRI behavior
if (finish && flater.needsInput()) {
RubyClass errorClass = runtime.fastGetModule("Zlib").fastGetClass("BufError");
throw new RaiseException(RubyException.newException(
runtime, errorClass, "buffer error"), true);
}
try {
resultLength = flater.inflate(outp);
if (flater.needsDictionary()) {
RubyClass errorClass = runtime.fastGetModule("Zlib").fastGetClass("NeedDict");
throw new RaiseException(RubyException.newException(
runtime, errorClass, "need dictionary"));
} else {
if (input.getRealSize() > 0) {
int remaining = flater.getRemaining();
if (remaining > 0) {