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

Print this page

        

@@ -116,11 +116,11 @@
     }
 }
 
 JNIEXPORT jint JNICALL
 Java_java_util_zip_Deflater_deflateBytes(JNIEnv *env, jobject this,
-                                         jarray b, jint off, jint len)
+                                         jarray b, jint off, jint len, jint flush)
 {
     z_stream *strm = jlong_to_ptr((*env)->GetLongField(env, this, strmID));
 
     if (strm == 0) {
         JNU_ThrowNullPointerException(env, 0);

@@ -195,11 +195,11 @@
 
             strm->next_in = (Bytef *) in_buf;
             strm->next_out = (Bytef *) out_buf;
             strm->avail_in = this_len;
             strm->avail_out = len;
-            res = deflate(strm, finish ? Z_FINISH : Z_NO_FLUSH);
+            res = deflate(strm, finish ? Z_FINISH : flush);
 
             if (res == Z_STREAM_END || res == Z_OK) {
                 (*env)->SetByteArrayRegion(env, b, off, len - strm->avail_out, out_buf);
             }
             free(out_buf);