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

Print this page




  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.Inflater
  28  */
  29 
  30 #include <stdio.h>
  31 #include <stdlib.h>
  32 #include <errno.h>
  33 #include <string.h>
  34 #include "jlong.h"
  35 #include "jni.h"
  36 #include "jvm.h"
  37 #include "jni_util.h"
  38 #include "zlib.h"
  39 #include "java_util_zip_Inflater.h"
  40 
  41 #define ThrowDataFormatException(env, msg) \
  42         JNU_ThrowByName(env, "java/util/zip/DataFormatException", msg)
  43 
  44 static jfieldID needDictID;
  45 static jfieldID finishedID;
  46 static jfieldID bufID, offID, lenID;
  47 
  48 JNIEXPORT void JNICALL
  49 Java_java_util_zip_Inflater_initIDs(JNIEnv *env, jclass cls)
  50 {
  51     needDictID = (*env)->GetFieldID(env, cls, "needDict", "Z");
  52     finishedID = (*env)->GetFieldID(env, cls, "finished", "Z");
  53     bufID = (*env)->GetFieldID(env, cls, "buf", "[B");
  54     offID = (*env)->GetFieldID(env, cls, "off", "I");
  55     lenID = (*env)->GetFieldID(env, cls, "len", "I");
  56 }
  57 
  58 JNIEXPORT jlong JNICALL




  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.Inflater
  28  */
  29 
  30 #include <stdio.h>
  31 #include <stdlib.h>
  32 #include <errno.h>
  33 #include <string.h>
  34 #include "jlong.h"
  35 #include "jni.h"
  36 #include "jvm.h"
  37 #include "jni_util.h"
  38 #include <zlib.h>
  39 #include "java_util_zip_Inflater.h"
  40 
  41 #define ThrowDataFormatException(env, msg) \
  42         JNU_ThrowByName(env, "java/util/zip/DataFormatException", msg)
  43 
  44 static jfieldID needDictID;
  45 static jfieldID finishedID;
  46 static jfieldID bufID, offID, lenID;
  47 
  48 JNIEXPORT void JNICALL
  49 Java_java_util_zip_Inflater_initIDs(JNIEnv *env, jclass cls)
  50 {
  51     needDictID = (*env)->GetFieldID(env, cls, "needDict", "Z");
  52     finishedID = (*env)->GetFieldID(env, cls, "finished", "Z");
  53     bufID = (*env)->GetFieldID(env, cls, "buf", "[B");
  54     offID = (*env)->GetFieldID(env, cls, "off", "I");
  55     lenID = (*env)->GetFieldID(env, cls, "len", "I");
  56 }
  57 
  58 JNIEXPORT jlong JNICALL