summaryrefslogtreecommitdiffstats
path: root/base/android/jni_array.h
blob: edf05c6c4fed436703f0de46a9d0558bfebdf52e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#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);

jobjectArray ToJavaArrayOfStrings(JNIEnv* env,
                                  const std::vector<std::string>& v);

}  // namespace android
}  // namespace base

#endif  // BASE_ANDROID_JNI_ARRAY_H_