summaryrefslogtreecommitdiffstats
path: root/base/android/jni_array.h
diff options
context:
space:
mode:
Diffstat (limited to 'base/android/jni_array.h')
-rw-r--r--base/android/jni_array.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/base/android/jni_array.h b/base/android/jni_array.h
new file mode 100644
index 0000000..ad73256
--- /dev/null
+++ b/base/android/jni_array.h
@@ -0,0 +1,25 @@
+// Copyright 2011 Google Inc. All Rights Reserved.
+// Author: michaelbai@google.com (Tao Bai)
+
+
+#ifndef BASE_ANDROID_JNI_ARRAY_H_
+#define BASE_ANDROID_JNI_ARRAY_H_
+
+#include <jni.h>
+#include <string>
+#include <vector>
+
+namespace base {
+namespace android {
+
+// Returns a new Java byte array converted from the given bytes array.
+jbyteArray ToJavaByteArray(JNIEnv* env, const unsigned char* bytes, size_t len);
+
+// Returns a array of Java byte array converted from |v|.
+jobjectArray ToJavaArrayOfByteArray(JNIEnv* env,
+ const std::vector<std::string>& v);
+
+} // namespace android
+} // namespace base
+
+#endif // BASE_ANDROID_JNI_ARRAY_H_