1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 // This file is autogenerated by
6 // base/android/jni_generator/jni_generator.py
10 #ifndef java_io_InputStream_JNI
11 #define java_io_InputStream_JNI
15 #include "base/android/jni_generator/jni_generator_helper.h"
17 #include "base/android/jni_int_wrapper.h"
19 // Step 1: forward declarations.
21 const char kInputStreamClassPath[] = "java/io/InputStream";
22 // Leaking this jclass as we cannot use LazyInstance from some threads.
23 jclass g_InputStream_clazz = NULL;
27 namespace JNI_InputStream {
29 // Step 2: method stubs.
31 static base::subtle::AtomicWord g_InputStream_available = 0;
32 static jint Java_InputStream_available(JNIEnv* env, jobject obj) __attribute__
34 static jint Java_InputStream_available(JNIEnv* env, jobject obj) {
35 /* Must call RegisterNativesImpl() */
37 g_InputStream_clazz, 0);
39 base::android::MethodID::LazyGet<
40 base::android::MethodID::TYPE_INSTANCE>(
41 env, g_InputStream_clazz,
44 &g_InputStream_available);
47 env->CallIntMethod(obj,
49 jni_generator::CheckException(env);
53 static base::subtle::AtomicWord g_InputStream_close = 0;
54 static void Java_InputStream_close(JNIEnv* env, jobject obj) __attribute__
56 static void Java_InputStream_close(JNIEnv* env, jobject obj) {
57 /* Must call RegisterNativesImpl() */
61 base::android::MethodID::LazyGet<
62 base::android::MethodID::TYPE_INSTANCE>(
63 env, g_InputStream_clazz,
66 &g_InputStream_close);
68 env->CallVoidMethod(obj,
70 jni_generator::CheckException(env);
74 static base::subtle::AtomicWord g_InputStream_mark = 0;
75 static void Java_InputStream_mark(JNIEnv* env, jobject obj, JniIntWrapper p0)
76 __attribute__ ((unused));
77 static void Java_InputStream_mark(JNIEnv* env, jobject obj, JniIntWrapper p0) {
78 /* Must call RegisterNativesImpl() */
82 base::android::MethodID::LazyGet<
83 base::android::MethodID::TYPE_INSTANCE>(
84 env, g_InputStream_clazz,
89 env->CallVoidMethod(obj,
90 method_id, as_jint(p0));
91 jni_generator::CheckException(env);
95 static base::subtle::AtomicWord g_InputStream_markSupported = 0;
96 static jboolean Java_InputStream_markSupported(JNIEnv* env, jobject obj)
97 __attribute__ ((unused));
98 static jboolean Java_InputStream_markSupported(JNIEnv* env, jobject obj) {
99 /* Must call RegisterNativesImpl() */
100 CHECK_CLAZZ(env, obj,
101 g_InputStream_clazz, false);
102 jmethodID method_id =
103 base::android::MethodID::LazyGet<
104 base::android::MethodID::TYPE_INSTANCE>(
105 env, g_InputStream_clazz,
108 &g_InputStream_markSupported);
111 env->CallBooleanMethod(obj,
113 jni_generator::CheckException(env);
117 static base::subtle::AtomicWord g_InputStream_readI = 0;
118 static jint Java_InputStream_readI(JNIEnv* env, jobject obj) __attribute__
120 static jint Java_InputStream_readI(JNIEnv* env, jobject obj) {
121 /* Must call RegisterNativesImpl() */
122 CHECK_CLAZZ(env, obj,
123 g_InputStream_clazz, 0);
124 jmethodID method_id =
125 base::android::MethodID::LazyGet<
126 base::android::MethodID::TYPE_INSTANCE>(
127 env, g_InputStream_clazz,
130 &g_InputStream_readI);
133 env->CallIntMethod(obj,
135 jni_generator::CheckException(env);
139 static base::subtle::AtomicWord g_InputStream_readI_AB = 0;
140 static jint Java_InputStream_readI_AB(JNIEnv* env, jobject obj, jbyteArray p0)
141 __attribute__ ((unused));
142 static jint Java_InputStream_readI_AB(JNIEnv* env, jobject obj, jbyteArray p0) {
143 /* Must call RegisterNativesImpl() */
144 CHECK_CLAZZ(env, obj,
145 g_InputStream_clazz, 0);
146 jmethodID method_id =
147 base::android::MethodID::LazyGet<
148 base::android::MethodID::TYPE_INSTANCE>(
149 env, g_InputStream_clazz,
152 &g_InputStream_readI_AB);
155 env->CallIntMethod(obj,
157 jni_generator::CheckException(env);
161 static base::subtle::AtomicWord g_InputStream_readI_AB_I_I = 0;
162 static jint Java_InputStream_readI_AB_I_I(JNIEnv* env, jobject obj, jbyteArray
165 JniIntWrapper p2) __attribute__ ((unused));
166 static jint Java_InputStream_readI_AB_I_I(JNIEnv* env, jobject obj, jbyteArray
170 /* Must call RegisterNativesImpl() */
171 CHECK_CLAZZ(env, obj,
172 g_InputStream_clazz, 0);
173 jmethodID method_id =
174 base::android::MethodID::LazyGet<
175 base::android::MethodID::TYPE_INSTANCE>(
176 env, g_InputStream_clazz,
179 &g_InputStream_readI_AB_I_I);
182 env->CallIntMethod(obj,
183 method_id, p0, as_jint(p1), as_jint(p2));
184 jni_generator::CheckException(env);
188 static base::subtle::AtomicWord g_InputStream_reset = 0;
189 static void Java_InputStream_reset(JNIEnv* env, jobject obj) __attribute__
191 static void Java_InputStream_reset(JNIEnv* env, jobject obj) {
192 /* Must call RegisterNativesImpl() */
193 CHECK_CLAZZ(env, obj,
194 g_InputStream_clazz);
195 jmethodID method_id =
196 base::android::MethodID::LazyGet<
197 base::android::MethodID::TYPE_INSTANCE>(
198 env, g_InputStream_clazz,
201 &g_InputStream_reset);
203 env->CallVoidMethod(obj,
205 jni_generator::CheckException(env);
209 static base::subtle::AtomicWord g_InputStream_skip = 0;
210 static jlong Java_InputStream_skip(JNIEnv* env, jobject obj, jlong p0)
211 __attribute__ ((unused));
212 static jlong Java_InputStream_skip(JNIEnv* env, jobject obj, jlong p0) {
213 /* Must call RegisterNativesImpl() */
214 CHECK_CLAZZ(env, obj,
215 g_InputStream_clazz, 0);
216 jmethodID method_id =
217 base::android::MethodID::LazyGet<
218 base::android::MethodID::TYPE_INSTANCE>(
219 env, g_InputStream_clazz,
222 &g_InputStream_skip);
225 env->CallLongMethod(obj,
227 jni_generator::CheckException(env);
231 static base::subtle::AtomicWord g_InputStream_Constructor = 0;
232 static base::android::ScopedJavaLocalRef<jobject>
233 Java_InputStream_Constructor(JNIEnv* env) __attribute__ ((unused));
234 static base::android::ScopedJavaLocalRef<jobject>
235 Java_InputStream_Constructor(JNIEnv* env) {
236 /* Must call RegisterNativesImpl() */
237 CHECK_CLAZZ(env, g_InputStream_clazz,
238 g_InputStream_clazz, NULL);
239 jmethodID method_id =
240 base::android::MethodID::LazyGet<
241 base::android::MethodID::TYPE_INSTANCE>(
242 env, g_InputStream_clazz,
245 &g_InputStream_Constructor);
248 env->NewObject(g_InputStream_clazz,
250 jni_generator::CheckException(env);
251 return base::android::ScopedJavaLocalRef<jobject>(env, ret);
254 // Step 3: RegisterNatives.
256 static bool RegisterNativesImpl(JNIEnv* env) {
257 g_InputStream_clazz = reinterpret_cast<jclass>(env->NewGlobalRef(
258 base::android::GetClass(env, kInputStreamClassPath).obj()));
263 } // namespace JNI_InputStream
265 #endif // java_io_InputStream_JNI