src/share/native/java/util/zip/Inflater.c

Print this page

        

@@ -140,19 +140,19 @@
     }
     strm->next_in  = (Bytef *) (in_buf + this_off);
     strm->next_out = (Bytef *) (out_buf + off);
     strm->avail_in  = this_len;
     strm->avail_out = len;
-    ret = inflate(strm, Z_PARTIAL_FLUSH);
+    ret = inflate(strm, Z_FINISH);
     (*env)->ReleasePrimitiveArrayCritical(env, b, out_buf, 0);
     (*env)->ReleasePrimitiveArrayCritical(env, this_buf, in_buf, 0);
 
     switch (ret) {
     case Z_STREAM_END:
         (*env)->SetBooleanField(env, this, finishedID, JNI_TRUE);
         /* fall through */
-    case Z_OK:
+    case Z_BUF_ERROR:
         this_off += this_len - strm->avail_in;
         (*env)->SetIntField(env, this, offID, this_off);
         (*env)->SetIntField(env, this, lenID, strm->avail_in);
         return len - strm->avail_out;
     case Z_NEED_DICT:

@@ -160,12 +160,10 @@
         /* Might have consumed some input here! */
         this_off += this_len - strm->avail_in;
         (*env)->SetIntField(env, this, offID, this_off);
         (*env)->SetIntField(env, this, lenID, strm->avail_in);
         return 0;
-    case Z_BUF_ERROR:
-        return 0;
     case Z_DATA_ERROR:
         ThrowDataFormatException(env, strm->msg);
         return 0;
     case Z_MEM_ERROR:
         JNU_ThrowOutOfMemoryError(env, 0);