// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // This file is autogenerated by // base/android/jni_generator/jni_generator.py // For // java/io/InputStream #ifndef java_io_InputStream_JNI #define java_io_InputStream_JNI #include #include "base/android/jni_generator/jni_generator_helper.h" #include "base/android/jni_int_wrapper.h" // Step 1: forward declarations. namespace { const char kInputStreamClassPath[] = "java/io/InputStream"; // Leaking this jclass as we cannot use LazyInstance from some threads. jclass g_InputStream_clazz = NULL; #define InputStream_clazz(env) g_InputStream_clazz } // namespace namespace JNI_InputStream { // Step 2: method stubs. static base::subtle::AtomicWord g_InputStream_available = 0; static jint Java_InputStream_available(JNIEnv* env, jobject obj) __attribute__ ((unused)); static jint Java_InputStream_available(JNIEnv* env, jobject obj) { /* Must call RegisterNativesImpl() */ CHECK_CLAZZ(env, obj, InputStream_clazz(env), 0); jmethodID method_id = base::android::MethodID::LazyGet< base::android::MethodID::TYPE_INSTANCE>( env, InputStream_clazz(env), "available", "()I", &g_InputStream_available); jint ret = env->CallIntMethod(obj, method_id); jni_generator::CheckException(env); return ret; } static base::subtle::AtomicWord g_InputStream_close = 0; static void Java_InputStream_close(JNIEnv* env, jobject obj) __attribute__ ((unused)); static void Java_InputStream_close(JNIEnv* env, jobject obj) { /* Must call RegisterNativesImpl() */ CHECK_CLAZZ(env, obj, InputStream_clazz(env)); jmethodID method_id = base::android::MethodID::LazyGet< base::android::MethodID::TYPE_INSTANCE>( env, InputStream_clazz(env), "close", "()V", &g_InputStream_close); env->CallVoidMethod(obj, method_id); jni_generator::CheckException(env); } static base::subtle::AtomicWord g_InputStream_mark = 0; static void Java_InputStream_mark(JNIEnv* env, jobject obj, JniIntWrapper p0) __attribute__ ((unused)); static void Java_InputStream_mark(JNIEnv* env, jobject obj, JniIntWrapper p0) { /* Must call RegisterNativesImpl() */ CHECK_CLAZZ(env, obj, InputStream_clazz(env)); jmethodID method_id = base::android::MethodID::LazyGet< base::android::MethodID::TYPE_INSTANCE>( env, InputStream_clazz(env), "mark", "(I)V", &g_InputStream_mark); env->CallVoidMethod(obj, method_id, as_jint(p0)); jni_generator::CheckException(env); } static base::subtle::AtomicWord g_InputStream_markSupported = 0; static jboolean Java_InputStream_markSupported(JNIEnv* env, jobject obj) __attribute__ ((unused)); static jboolean Java_InputStream_markSupported(JNIEnv* env, jobject obj) { /* Must call RegisterNativesImpl() */ CHECK_CLAZZ(env, obj, InputStream_clazz(env), false); jmethodID method_id = base::android::MethodID::LazyGet< base::android::MethodID::TYPE_INSTANCE>( env, InputStream_clazz(env), "markSupported", "()Z", &g_InputStream_markSupported); jboolean ret = env->CallBooleanMethod(obj, method_id); jni_generator::CheckException(env); return ret; } static base::subtle::AtomicWord g_InputStream_readI = 0; static jint Java_InputStream_readI(JNIEnv* env, jobject obj) __attribute__ ((unused)); static jint Java_InputStream_readI(JNIEnv* env, jobject obj) { /* Must call RegisterNativesImpl() */ CHECK_CLAZZ(env, obj, InputStream_clazz(env), 0); jmethodID method_id = base::android::MethodID::LazyGet< base::android::MethodID::TYPE_INSTANCE>( env, InputStream_clazz(env), "read", "()I", &g_InputStream_readI); jint ret = env->CallIntMethod(obj, method_id); jni_generator::CheckException(env); return ret; } static base::subtle::AtomicWord g_InputStream_readI_AB = 0; static jint Java_InputStream_readI_AB(JNIEnv* env, jobject obj, jbyteArray p0) __attribute__ ((unused)); static jint Java_InputStream_readI_AB(JNIEnv* env, jobject obj, jbyteArray p0) { /* Must call RegisterNativesImpl() */ CHECK_CLAZZ(env, obj, InputStream_clazz(env), 0); jmethodID method_id = base::android::MethodID::LazyGet< base::android::MethodID::TYPE_INSTANCE>( env, InputStream_clazz(env), "read", "([B)I", &g_InputStream_readI_AB); jint ret = env->CallIntMethod(obj, method_id, p0); jni_generator::CheckException(env); return ret; } static base::subtle::AtomicWord g_InputStream_readI_AB_I_I = 0; static jint Java_InputStream_readI_AB_I_I(JNIEnv* env, jobject obj, jbyteArray p0, JniIntWrapper p1, JniIntWrapper p2) __attribute__ ((unused)); static jint Java_InputStream_readI_AB_I_I(JNIEnv* env, jobject obj, jbyteArray p0, JniIntWrapper p1, JniIntWrapper p2) { /* Must call RegisterNativesImpl() */ CHECK_CLAZZ(env, obj, InputStream_clazz(env), 0); jmethodID method_id = base::android::MethodID::LazyGet< base::android::MethodID::TYPE_INSTANCE>( env, InputStream_clazz(env), "read", "([BII)I", &g_InputStream_readI_AB_I_I); jint ret = env->CallIntMethod(obj, method_id, p0, as_jint(p1), as_jint(p2)); jni_generator::CheckException(env); return ret; } static base::subtle::AtomicWord g_InputStream_reset = 0; static void Java_InputStream_reset(JNIEnv* env, jobject obj) __attribute__ ((unused)); static void Java_InputStream_reset(JNIEnv* env, jobject obj) { /* Must call RegisterNativesImpl() */ CHECK_CLAZZ(env, obj, InputStream_clazz(env)); jmethodID method_id = base::android::MethodID::LazyGet< base::android::MethodID::TYPE_INSTANCE>( env, InputStream_clazz(env), "reset", "()V", &g_InputStream_reset); env->CallVoidMethod(obj, method_id); jni_generator::CheckException(env); } static base::subtle::AtomicWord g_InputStream_skip = 0; static jlong Java_InputStream_skip(JNIEnv* env, jobject obj, jlong p0) __attribute__ ((unused)); static jlong Java_InputStream_skip(JNIEnv* env, jobject obj, jlong p0) { /* Must call RegisterNativesImpl() */ CHECK_CLAZZ(env, obj, InputStream_clazz(env), 0); jmethodID method_id = base::android::MethodID::LazyGet< base::android::MethodID::TYPE_INSTANCE>( env, InputStream_clazz(env), "skip", "(J)J", &g_InputStream_skip); jlong ret = env->CallLongMethod(obj, method_id, p0); jni_generator::CheckException(env); return ret; } static base::subtle::AtomicWord g_InputStream_Constructor = 0; static base::android::ScopedJavaLocalRef Java_InputStream_Constructor(JNIEnv* env) __attribute__ ((unused)); static base::android::ScopedJavaLocalRef Java_InputStream_Constructor(JNIEnv* env) { /* Must call RegisterNativesImpl() */ CHECK_CLAZZ(env, InputStream_clazz(env), InputStream_clazz(env), NULL); jmethodID method_id = base::android::MethodID::LazyGet< base::android::MethodID::TYPE_INSTANCE>( env, InputStream_clazz(env), "", "()V", &g_InputStream_Constructor); jobject ret = env->NewObject(InputStream_clazz(env), method_id); jni_generator::CheckException(env); return base::android::ScopedJavaLocalRef(env, ret); } // Step 3: RegisterNatives. static bool RegisterNativesImpl(JNIEnv* env) { g_InputStream_clazz = reinterpret_cast(env->NewGlobalRef( base::android::GetClass(env, kInputStreamClassPath).obj())); return true; } } // namespace JNI_InputStream #endif // java_io_InputStream_JNI