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 // Step 1: forward declarations.
19 const char kInputStreamClassPath[] = "java/io/InputStream";
20 // Leaking this jclass as we cannot use LazyInstance from some threads.
21 jclass g_InputStream_clazz = NULL;
25 namespace JNI_InputStream {
27 // Step 2: method stubs.
29 static base::subtle::AtomicWord g_InputStream_available = 0;
30 static jint Java_InputStream_available(JNIEnv* env, jobject obj) __attribute__
32 static jint Java_InputStream_available(JNIEnv* env, jobject obj) {
33 /* Must call RegisterNativesImpl() */
35 g_InputStream_clazz, 0);
37 base::android::MethodID::LazyGet<
38 base::android::MethodID::TYPE_INSTANCE>(
39 env, g_InputStream_clazz,
42 &g_InputStream_available);
45 env->CallIntMethod(obj,
47 jni_generator::CheckException(env);
51 static base::subtle::AtomicWord g_InputStream_close = 0;
52 static void Java_InputStream_close(JNIEnv* env, jobject obj) __attribute__
54 static void Java_InputStream_close(JNIEnv* env, jobject obj) {
55 /* Must call RegisterNativesImpl() */
59 base::android::MethodID::LazyGet<
60 base::android::MethodID::TYPE_INSTANCE>(
61 env, g_InputStream_clazz,
64 &g_InputStream_close);
66 env->CallVoidMethod(obj,
68 jni_generator::CheckException(env);
72 static base::subtle::AtomicWord g_InputStream_mark = 0;
73 static void Java_InputStream_mark(JNIEnv* env, jobject obj, jint p0)
74 __attribute__ ((unused));
75 static void Java_InputStream_mark(JNIEnv* env, jobject obj, jint p0) {
76 /* Must call RegisterNativesImpl() */
80 base::android::MethodID::LazyGet<
81 base::android::MethodID::TYPE_INSTANCE>(
82 env, g_InputStream_clazz,
87 env->CallVoidMethod(obj,
89 jni_generator::CheckException(env);
93 static base::subtle::AtomicWord g_InputStream_markSupported = 0;
94 static jboolean Java_InputStream_markSupported(JNIEnv* env, jobject obj)
95 __attribute__ ((unused));
96 static jboolean Java_InputStream_markSupported(JNIEnv* env, jobject obj) {
97 /* Must call RegisterNativesImpl() */
99 g_InputStream_clazz, false);
100 jmethodID method_id =
101 base::android::MethodID::LazyGet<
102 base::android::MethodID::TYPE_INSTANCE>(
103 env, g_InputStream_clazz,
106 &g_InputStream_markSupported);
109 env->CallBooleanMethod(obj,
111 jni_generator::CheckException(env);
115 static base::subtle::AtomicWord g_InputStream_readI = 0;
116 static jint Java_InputStream_readI(JNIEnv* env, jobject obj) __attribute__
118 static jint Java_InputStream_readI(JNIEnv* env, jobject obj) {
119 /* Must call RegisterNativesImpl() */
120 CHECK_CLAZZ(env, obj,
121 g_InputStream_clazz, 0);
122 jmethodID method_id =
123 base::android::MethodID::LazyGet<
124 base::android::MethodID::TYPE_INSTANCE>(
125 env, g_InputStream_clazz,
128 &g_InputStream_readI);
131 env->CallIntMethod(obj,
133 jni_generator::CheckException(env);
137 static base::subtle::AtomicWord g_InputStream_readI_AB = 0;
138 static jint Java_InputStream_readI_AB(JNIEnv* env, jobject obj, jbyteArray p0)
139 __attribute__ ((unused));
140 static jint Java_InputStream_readI_AB(JNIEnv* env, jobject obj, jbyteArray p0) {
141 /* Must call RegisterNativesImpl() */
142 CHECK_CLAZZ(env, obj,
143 g_InputStream_clazz, 0);
144 jmethodID method_id =
145 base::android::MethodID::LazyGet<
146 base::android::MethodID::TYPE_INSTANCE>(
147 env, g_InputStream_clazz,
150 &g_InputStream_readI_AB);
153 env->CallIntMethod(obj,
155 jni_generator::CheckException(env);
159 static base::subtle::AtomicWord g_InputStream_readI_AB_I_I = 0;
160 static jint Java_InputStream_readI_AB_I_I(JNIEnv* env, jobject obj, jbyteArray
163 jint p2) __attribute__ ((unused));
164 static jint Java_InputStream_readI_AB_I_I(JNIEnv* env, jobject obj, jbyteArray
168 /* Must call RegisterNativesImpl() */
169 CHECK_CLAZZ(env, obj,
170 g_InputStream_clazz, 0);
171 jmethodID method_id =
172 base::android::MethodID::LazyGet<
173 base::android::MethodID::TYPE_INSTANCE>(
174 env, g_InputStream_clazz,
177 &g_InputStream_readI_AB_I_I);
180 env->CallIntMethod(obj,
181 method_id, p0, p1, p2);
182 jni_generator::CheckException(env);
186 static base::subtle::AtomicWord g_InputStream_reset = 0;
187 static void Java_InputStream_reset(JNIEnv* env, jobject obj) __attribute__
189 static void Java_InputStream_reset(JNIEnv* env, jobject obj) {
190 /* Must call RegisterNativesImpl() */
191 CHECK_CLAZZ(env, obj,
192 g_InputStream_clazz);
193 jmethodID method_id =
194 base::android::MethodID::LazyGet<
195 base::android::MethodID::TYPE_INSTANCE>(
196 env, g_InputStream_clazz,
199 &g_InputStream_reset);
201 env->CallVoidMethod(obj,
203 jni_generator::CheckException(env);
207 static base::subtle::AtomicWord g_InputStream_skip = 0;
208 static jlong Java_InputStream_skip(JNIEnv* env, jobject obj, jlong p0)
209 __attribute__ ((unused));
210 static jlong Java_InputStream_skip(JNIEnv* env, jobject obj, jlong p0) {
211 /* Must call RegisterNativesImpl() */
212 CHECK_CLAZZ(env, obj,
213 g_InputStream_clazz, 0);
214 jmethodID method_id =
215 base::android::MethodID::LazyGet<
216 base::android::MethodID::TYPE_INSTANCE>(
217 env, g_InputStream_clazz,
220 &g_InputStream_skip);
223 env->CallLongMethod(obj,
225 jni_generator::CheckException(env);
229 static base::subtle::AtomicWord g_InputStream_Constructor = 0;
230 static base::android::ScopedJavaLocalRef<jobject>
231 Java_InputStream_Constructor(JNIEnv* env) __attribute__ ((unused));
232 static base::android::ScopedJavaLocalRef<jobject>
233 Java_InputStream_Constructor(JNIEnv* env) {
234 /* Must call RegisterNativesImpl() */
235 CHECK_CLAZZ(env, g_InputStream_clazz,
236 g_InputStream_clazz, NULL);
237 jmethodID method_id =
238 base::android::MethodID::LazyGet<
239 base::android::MethodID::TYPE_INSTANCE>(
240 env, g_InputStream_clazz,
243 &g_InputStream_Constructor);
246 env->NewObject(g_InputStream_clazz,
248 jni_generator::CheckException(env);
249 return base::android::ScopedJavaLocalRef<jobject>(env, ret);
252 // Step 3: RegisterNatives.
254 static bool RegisterNativesImpl(JNIEnv* env) {
255 g_InputStream_clazz = reinterpret_cast<jclass>(env->NewGlobalRef(
256 base::android::GetClass(env, kInputStreamClassPath).obj()));
261 } // namespace JNI_InputStream
263 #endif // java_io_InputStream_JNI