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. 4 5 6 // This file is autogenerated by 7 // base/android/jni_generator/jni_generator.py 8 // For 9 // java/io/InputStream 10 11 #ifndef java_io_InputStream_JNI 12 #define java_io_InputStream_JNI 13 14 #include <jni.h> 15 16 #include "base/android/jni_generator/jni_generator_helper.h" 17 18 19 // Step 1: Forward declarations. 20 21 JNI_REGISTRATION_EXPORT extern const char kClassPath_java_io_InputStream[]; 22 const char kClassPath_java_io_InputStream[] = "java/io/InputStream"; 23 // Leaking this jclass as we cannot use LazyInstance from some threads. 24 JNI_REGISTRATION_EXPORT base::subtle::AtomicWord g_java_io_InputStream_clazz = 0; 25 #ifndef java_io_InputStream_clazz_defined 26 #define java_io_InputStream_clazz_defined 27 inline jclass java_io_InputStream_clazz(JNIEnv* env) { 28 return base::android::LazyGetClass(env, kClassPath_java_io_InputStream, 29 &g_java_io_InputStream_clazz); 30 } 31 #endif 32 33 34 // Step 2: Constants (optional). 35 36 37 // Step 3: Method stubs. 38 namespace JNI_InputStream { 39 40 41 static base::subtle::AtomicWord g_java_io_InputStream_available = 0; 42 static jint Java_InputStream_available(JNIEnv* env, const base::android::JavaRef<jobject>& obj) 43 __attribute__ ((unused)); 44 static jint Java_InputStream_available(JNIEnv* env, const base::android::JavaRef<jobject>& obj) { 45 CHECK_CLAZZ(env, obj.obj(), 46 java_io_InputStream_clazz(env), 0); 47 jmethodID method_id = base::android::MethodID::LazyGet< 48 base::android::MethodID::TYPE_INSTANCE>( 49 env, java_io_InputStream_clazz(env), 50 "available", 51 "()I", 52 &g_java_io_InputStream_available); 53 54 jint ret = 55 env->CallIntMethod(obj.obj(), 56 method_id); 57 jni_generator::CheckException(env); 58 return ret; 59 } 60 61 static base::subtle::AtomicWord g_java_io_InputStream_close = 0; 62 static void Java_InputStream_close(JNIEnv* env, const base::android::JavaRef<jobject>& obj) 63 __attribute__ ((unused)); 64 static void Java_InputStream_close(JNIEnv* env, const base::android::JavaRef<jobject>& obj) { 65 CHECK_CLAZZ(env, obj.obj(), 66 java_io_InputStream_clazz(env)); 67 jmethodID method_id = base::android::MethodID::LazyGet< 68 base::android::MethodID::TYPE_INSTANCE>( 69 env, java_io_InputStream_clazz(env), 70 "close", 71 "()V", 72 &g_java_io_InputStream_close); 73 74 env->CallVoidMethod(obj.obj(), 75 method_id); 76 jni_generator::CheckException(env); 77 } 78 79 static base::subtle::AtomicWord g_java_io_InputStream_mark = 0; 80 static void Java_InputStream_mark(JNIEnv* env, const base::android::JavaRef<jobject>& obj, 81 JniIntWrapper p0) __attribute__ ((unused)); 82 static void Java_InputStream_mark(JNIEnv* env, const base::android::JavaRef<jobject>& obj, 83 JniIntWrapper p0) { 84 CHECK_CLAZZ(env, obj.obj(), 85 java_io_InputStream_clazz(env)); 86 jmethodID method_id = base::android::MethodID::LazyGet< 87 base::android::MethodID::TYPE_INSTANCE>( 88 env, java_io_InputStream_clazz(env), 89 "mark", 90 "(I)V", 91 &g_java_io_InputStream_mark); 92 93 env->CallVoidMethod(obj.obj(), 94 method_id, as_jint(p0)); 95 jni_generator::CheckException(env); 96 } 97 98 static base::subtle::AtomicWord g_java_io_InputStream_markSupported = 0; 99 static jboolean Java_InputStream_markSupported(JNIEnv* env, const base::android::JavaRef<jobject>& 100 obj) __attribute__ ((unused)); 101 static jboolean Java_InputStream_markSupported(JNIEnv* env, const base::android::JavaRef<jobject>& 102 obj) { 103 CHECK_CLAZZ(env, obj.obj(), 104 java_io_InputStream_clazz(env), false); 105 jmethodID method_id = base::android::MethodID::LazyGet< 106 base::android::MethodID::TYPE_INSTANCE>( 107 env, java_io_InputStream_clazz(env), 108 "markSupported", 109 "()Z", 110 &g_java_io_InputStream_markSupported); 111 112 jboolean ret = 113 env->CallBooleanMethod(obj.obj(), 114 method_id); 115 jni_generator::CheckException(env); 116 return ret; 117 } 118 119 static base::subtle::AtomicWord g_java_io_InputStream_readI = 0; 120 static jint Java_InputStream_readI(JNIEnv* env, const base::android::JavaRef<jobject>& obj) 121 __attribute__ ((unused)); 122 static jint Java_InputStream_readI(JNIEnv* env, const base::android::JavaRef<jobject>& obj) { 123 CHECK_CLAZZ(env, obj.obj(), 124 java_io_InputStream_clazz(env), 0); 125 jmethodID method_id = base::android::MethodID::LazyGet< 126 base::android::MethodID::TYPE_INSTANCE>( 127 env, java_io_InputStream_clazz(env), 128 "read", 129 "()I", 130 &g_java_io_InputStream_readI); 131 132 jint ret = 133 env->CallIntMethod(obj.obj(), 134 method_id); 135 jni_generator::CheckException(env); 136 return ret; 137 } 138 139 static base::subtle::AtomicWord g_java_io_InputStream_readI_AB = 0; 140 static jint Java_InputStream_readI_AB(JNIEnv* env, const base::android::JavaRef<jobject>& obj, const 141 base::android::JavaRef<jbyteArray>& p0) __attribute__ ((unused)); 142 static jint Java_InputStream_readI_AB(JNIEnv* env, const base::android::JavaRef<jobject>& obj, const 143 base::android::JavaRef<jbyteArray>& p0) { 144 CHECK_CLAZZ(env, obj.obj(), 145 java_io_InputStream_clazz(env), 0); 146 jmethodID method_id = base::android::MethodID::LazyGet< 147 base::android::MethodID::TYPE_INSTANCE>( 148 env, java_io_InputStream_clazz(env), 149 "read", 150 "([B)I", 151 &g_java_io_InputStream_readI_AB); 152 153 jint ret = 154 env->CallIntMethod(obj.obj(), 155 method_id, p0.obj()); 156 jni_generator::CheckException(env); 157 return ret; 158 } 159 160 static base::subtle::AtomicWord g_java_io_InputStream_readI_AB_I_I = 0; 161 static jint Java_InputStream_readI_AB_I_I(JNIEnv* env, const base::android::JavaRef<jobject>& obj, 162 const base::android::JavaRef<jbyteArray>& p0, 163 JniIntWrapper p1, 164 JniIntWrapper p2) __attribute__ ((unused)); 165 static jint Java_InputStream_readI_AB_I_I(JNIEnv* env, const base::android::JavaRef<jobject>& obj, 166 const base::android::JavaRef<jbyteArray>& p0, 167 JniIntWrapper p1, 168 JniIntWrapper p2) { 169 CHECK_CLAZZ(env, obj.obj(), 170 java_io_InputStream_clazz(env), 0); 171 jmethodID method_id = base::android::MethodID::LazyGet< 172 base::android::MethodID::TYPE_INSTANCE>( 173 env, java_io_InputStream_clazz(env), 174 "read", 175 "([BII)I", 176 &g_java_io_InputStream_readI_AB_I_I); 177 178 jint ret = 179 env->CallIntMethod(obj.obj(), 180 method_id, p0.obj(), as_jint(p1), as_jint(p2)); 181 jni_generator::CheckException(env); 182 return ret; 183 } 184 185 static base::subtle::AtomicWord g_java_io_InputStream_reset = 0; 186 static void Java_InputStream_reset(JNIEnv* env, const base::android::JavaRef<jobject>& obj) 187 __attribute__ ((unused)); 188 static void Java_InputStream_reset(JNIEnv* env, const base::android::JavaRef<jobject>& obj) { 189 CHECK_CLAZZ(env, obj.obj(), 190 java_io_InputStream_clazz(env)); 191 jmethodID method_id = base::android::MethodID::LazyGet< 192 base::android::MethodID::TYPE_INSTANCE>( 193 env, java_io_InputStream_clazz(env), 194 "reset", 195 "()V", 196 &g_java_io_InputStream_reset); 197 198 env->CallVoidMethod(obj.obj(), 199 method_id); 200 jni_generator::CheckException(env); 201 } 202 203 static base::subtle::AtomicWord g_java_io_InputStream_skip = 0; 204 static jlong Java_InputStream_skip(JNIEnv* env, const base::android::JavaRef<jobject>& obj, jlong 205 p0) __attribute__ ((unused)); 206 static jlong Java_InputStream_skip(JNIEnv* env, const base::android::JavaRef<jobject>& obj, jlong 207 p0) { 208 CHECK_CLAZZ(env, obj.obj(), 209 java_io_InputStream_clazz(env), 0); 210 jmethodID method_id = base::android::MethodID::LazyGet< 211 base::android::MethodID::TYPE_INSTANCE>( 212 env, java_io_InputStream_clazz(env), 213 "skip", 214 "(J)J", 215 &g_java_io_InputStream_skip); 216 217 jlong ret = 218 env->CallLongMethod(obj.obj(), 219 method_id, p0); 220 jni_generator::CheckException(env); 221 return ret; 222 } 223 224 static base::subtle::AtomicWord g_java_io_InputStream_Constructor = 0; 225 static base::android::ScopedJavaLocalRef<jobject> Java_InputStream_Constructor(JNIEnv* env) 226 __attribute__ ((unused)); 227 static base::android::ScopedJavaLocalRef<jobject> Java_InputStream_Constructor(JNIEnv* env) { 228 CHECK_CLAZZ(env, java_io_InputStream_clazz(env), 229 java_io_InputStream_clazz(env), NULL); 230 jmethodID method_id = base::android::MethodID::LazyGet< 231 base::android::MethodID::TYPE_INSTANCE>( 232 env, java_io_InputStream_clazz(env), 233 "<init>", 234 "()V", 235 &g_java_io_InputStream_Constructor); 236 237 jobject ret = 238 env->NewObject(java_io_InputStream_clazz(env), 239 method_id); 240 jni_generator::CheckException(env); 241 return base::android::ScopedJavaLocalRef<jobject>(env, ret); 242 } 243 244 } // namespace JNI_InputStream 245 246 #endif // java_io_InputStream_JNI 247