1 // Copyright 2014 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;
24 #define InputStream_clazz(env) g_InputStream_clazz
28 namespace JNI_InputStream {
30 // Step 2: method stubs.
32 static base::subtle::AtomicWord g_InputStream_available = 0;
33 static jint Java_InputStream_available(JNIEnv* env, jobject obj) __attribute__
35 static jint Java_InputStream_available(JNIEnv* env, jobject obj) {
36 /* Must call RegisterNativesImpl() */
38 InputStream_clazz(env), 0);
40 base::android::MethodID::LazyGet<
41 base::android::MethodID::TYPE_INSTANCE>(
42 env, InputStream_clazz(env),
45 &g_InputStream_available);
48 env->CallIntMethod(obj,
50 jni_generator::CheckException(env);
54 static base::subtle::AtomicWord g_InputStream_close = 0;
55 static void Java_InputStream_close(JNIEnv* env, jobject obj) __attribute__
57 static void Java_InputStream_close(JNIEnv* env, jobject obj) {
58 /* Must call RegisterNativesImpl() */
60 InputStream_clazz(env));
62 base::android::MethodID::LazyGet<
63 base::android::MethodID::TYPE_INSTANCE>(
64 env, InputStream_clazz(env),
67 &g_InputStream_close);
69 env->CallVoidMethod(obj,
71 jni_generator::CheckException(env);
75 static base::subtle::AtomicWord g_InputStream_mark = 0;
76 static void Java_InputStream_mark(JNIEnv* env, jobject obj, JniIntWrapper p0)
77 __attribute__ ((unused));
78 static void Java_InputStream_mark(JNIEnv* env, jobject obj, JniIntWrapper p0) {
79 /* Must call RegisterNativesImpl() */
81 InputStream_clazz(env));
83 base::android::MethodID::LazyGet<
84 base::android::MethodID::TYPE_INSTANCE>(
85 env, InputStream_clazz(env),
90 env->CallVoidMethod(obj,
91 method_id, as_jint(p0));
92 jni_generator::CheckException(env);
96 static base::subtle::AtomicWord g_InputStream_markSupported = 0;
97 static jboolean Java_InputStream_markSupported(JNIEnv* env, jobject obj)
98 __attribute__ ((unused));
99 static jboolean Java_InputStream_markSupported(JNIEnv* env, jobject obj) {
100 /* Must call RegisterNativesImpl() */
101 CHECK_CLAZZ(env, obj,
102 InputStream_clazz(env), false);
103 jmethodID method_id =
104 base::android::MethodID::LazyGet<
105 base::android::MethodID::TYPE_INSTANCE>(
106 env, InputStream_clazz(env),
109 &g_InputStream_markSupported);
112 env->CallBooleanMethod(obj,
114 jni_generator::CheckException(env);
118 static base::subtle::AtomicWord g_InputStream_readI = 0;
119 static jint Java_InputStream_readI(JNIEnv* env, jobject obj) __attribute__
121 static jint Java_InputStream_readI(JNIEnv* env, jobject obj) {
122 /* Must call RegisterNativesImpl() */
123 CHECK_CLAZZ(env, obj,
124 InputStream_clazz(env), 0);
125 jmethodID method_id =
126 base::android::MethodID::LazyGet<
127 base::android::MethodID::TYPE_INSTANCE>(
128 env, InputStream_clazz(env),
131 &g_InputStream_readI);
134 env->CallIntMethod(obj,
136 jni_generator::CheckException(env);
140 static base::subtle::AtomicWord g_InputStream_readI_AB = 0;
141 static jint Java_InputStream_readI_AB(JNIEnv* env, jobject obj, jbyteArray p0)
142 __attribute__ ((unused));
143 static jint Java_InputStream_readI_AB(JNIEnv* env, jobject obj, jbyteArray p0) {
144 /* Must call RegisterNativesImpl() */
145 CHECK_CLAZZ(env, obj,
146 InputStream_clazz(env), 0);
147 jmethodID method_id =
148 base::android::MethodID::LazyGet<
149 base::android::MethodID::TYPE_INSTANCE>(
150 env, InputStream_clazz(env),
153 &g_InputStream_readI_AB);
156 env->CallIntMethod(obj,
158 jni_generator::CheckException(env);
162 static base::subtle::AtomicWord g_InputStream_readI_AB_I_I = 0;
163 static jint Java_InputStream_readI_AB_I_I(JNIEnv* env, jobject obj, jbyteArray
166 JniIntWrapper p2) __attribute__ ((unused));
167 static jint Java_InputStream_readI_AB_I_I(JNIEnv* env, jobject obj, jbyteArray
171 /* Must call RegisterNativesImpl() */
172 CHECK_CLAZZ(env, obj,
173 InputStream_clazz(env), 0);
174 jmethodID method_id =
175 base::android::MethodID::LazyGet<
176 base::android::MethodID::TYPE_INSTANCE>(
177 env, InputStream_clazz(env),
180 &g_InputStream_readI_AB_I_I);
183 env->CallIntMethod(obj,
184 method_id, p0, as_jint(p1), as_jint(p2));
185 jni_generator::CheckException(env);
189 static base::subtle::AtomicWord g_InputStream_reset = 0;
190 static void Java_InputStream_reset(JNIEnv* env, jobject obj) __attribute__
192 static void Java_InputStream_reset(JNIEnv* env, jobject obj) {
193 /* Must call RegisterNativesImpl() */
194 CHECK_CLAZZ(env, obj,
195 InputStream_clazz(env));
196 jmethodID method_id =
197 base::android::MethodID::LazyGet<
198 base::android::MethodID::TYPE_INSTANCE>(
199 env, InputStream_clazz(env),
202 &g_InputStream_reset);
204 env->CallVoidMethod(obj,
206 jni_generator::CheckException(env);
210 static base::subtle::AtomicWord g_InputStream_skip = 0;
211 static jlong Java_InputStream_skip(JNIEnv* env, jobject obj, jlong p0)
212 __attribute__ ((unused));
213 static jlong Java_InputStream_skip(JNIEnv* env, jobject obj, jlong p0) {
214 /* Must call RegisterNativesImpl() */
215 CHECK_CLAZZ(env, obj,
216 InputStream_clazz(env), 0);
217 jmethodID method_id =
218 base::android::MethodID::LazyGet<
219 base::android::MethodID::TYPE_INSTANCE>(
220 env, InputStream_clazz(env),
223 &g_InputStream_skip);
226 env->CallLongMethod(obj,
228 jni_generator::CheckException(env);
232 static base::subtle::AtomicWord g_InputStream_Constructor = 0;
233 static ScopedJavaLocalRef<jobject> Java_InputStream_Constructor(JNIEnv* env)
234 __attribute__ ((unused));
235 static ScopedJavaLocalRef<jobject> Java_InputStream_Constructor(JNIEnv* env) {
236 /* Must call RegisterNativesImpl() */
237 CHECK_CLAZZ(env, InputStream_clazz(env),
238 InputStream_clazz(env), NULL);
239 jmethodID method_id =
240 base::android::MethodID::LazyGet<
241 base::android::MethodID::TYPE_INSTANCE>(
242 env, InputStream_clazz(env),
245 &g_InputStream_Constructor);
248 env->NewObject(InputStream_clazz(env),
250 jni_generator::CheckException(env);
251 return ScopedJavaLocalRef<jobject>(env, ret);
254 // Step 3: RegisterNatives.
256 static bool RegisterNativesImpl(JNIEnv* env) {
258 g_InputStream_clazz = reinterpret_cast<jclass>(env->NewGlobalRef(
259 base::android::GetClass(env, kInputStreamClassPath).obj()));
264 } // namespace JNI_InputStream
266 #endif // java_io_InputStream_JNI