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

Print this page




  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 /*
  27  * Native method support for java.util.zip.Deflater
  28  */
  29 
  30 #include <stdio.h>
  31 #include <stdlib.h>
  32 #include "jlong.h"
  33 #include "jni.h"
  34 #include "jni_util.h"
  35 #include "zlib.h"
  36 
  37 #include "java_util_zip_Deflater.h"
  38 
  39 #define DEF_MEM_LEVEL 8
  40 
  41 static jfieldID levelID;
  42 static jfieldID strategyID;
  43 static jfieldID setParamsID;
  44 static jfieldID finishID;
  45 static jfieldID finishedID;
  46 static jfieldID bufID, offID, lenID;
  47 
  48 JNIEXPORT void JNICALL
  49 Java_java_util_zip_Deflater_initIDs(JNIEnv *env, jclass cls)
  50 {
  51     levelID = (*env)->GetFieldID(env, cls, "level", "I");
  52     strategyID = (*env)->GetFieldID(env, cls, "strategy", "I");
  53     setParamsID = (*env)->GetFieldID(env, cls, "setParams", "Z");
  54     finishID = (*env)->GetFieldID(env, cls, "finish", "Z");
  55     finishedID = (*env)->GetFieldID(env, cls, "finished", "Z");




  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 /*
  27  * Native method support for java.util.zip.Deflater
  28  */
  29 
  30 #include <stdio.h>
  31 #include <stdlib.h>
  32 #include "jlong.h"
  33 #include "jni.h"
  34 #include "jni_util.h"
  35 #include <zlib.h>
  36 
  37 #include "java_util_zip_Deflater.h"
  38 
  39 #define DEF_MEM_LEVEL 8
  40 
  41 static jfieldID levelID;
  42 static jfieldID strategyID;
  43 static jfieldID setParamsID;
  44 static jfieldID finishID;
  45 static jfieldID finishedID;
  46 static jfieldID bufID, offID, lenID;
  47 
  48 JNIEXPORT void JNICALL
  49 Java_java_util_zip_Deflater_initIDs(JNIEnv *env, jclass cls)
  50 {
  51     levelID = (*env)->GetFieldID(env, cls, "level", "I");
  52     strategyID = (*env)->GetFieldID(env, cls, "strategy", "I");
  53     setParamsID = (*env)->GetFieldID(env, cls, "setParams", "Z");
  54     finishID = (*env)->GetFieldID(env, cls, "finish", "Z");
  55     finishedID = (*env)->GetFieldID(env, cls, "finished", "Z");