| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef BASE_ANDROID_JNI_ARRAY_H_ | 5 #ifndef BASE_ANDROID_JNI_ARRAY_H_ |
| 6 #define BASE_ANDROID_JNI_ARRAY_H_ | 6 #define BASE_ANDROID_JNI_ARRAY_H_ |
| 7 | 7 |
| 8 #include <jni.h> | 8 #include <jni.h> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 // Appends the Java bytes in |bytes_array| onto the end of |out|. | 42 // Appends the Java bytes in |bytes_array| onto the end of |out|. |
| 43 void AppendJavaByteArrayToByteVector(JNIEnv* env, | 43 void AppendJavaByteArrayToByteVector(JNIEnv* env, |
| 44 jbyteArray byte_array, | 44 jbyteArray byte_array, |
| 45 std::vector<uint8>* out); | 45 std::vector<uint8>* out); |
| 46 | 46 |
| 47 // Replaces the content of |out| with the Java bytes in |bytes_array|. | 47 // Replaces the content of |out| with the Java bytes in |bytes_array|. |
| 48 void JavaByteArrayToByteVector(JNIEnv* env, | 48 void JavaByteArrayToByteVector(JNIEnv* env, |
| 49 jbyteArray byte_array, | 49 jbyteArray byte_array, |
| 50 std::vector<uint8>* out); | 50 std::vector<uint8>* out); |
| 51 | 51 |
| 52 // Replaces the content of |out| with the Java ints in |int_array|. |
| 53 void JavaIntArrayToIntVector(JNIEnv* env, |
| 54 jintArray int_array, |
| 55 std::vector<int>* out); |
| 56 |
| 52 } // namespace android | 57 } // namespace android |
| 53 } // namespace base | 58 } // namespace base |
| 54 | 59 |
| 55 #endif // BASE_ANDROID_JNI_ARRAY_H_ | 60 #endif // BASE_ANDROID_JNI_ARRAY_H_ |
| OLD | NEW |