String-->InputStream

String str = "abc";
InputStream inputStream = new ByteArrayInputStream(str.getBytes());

InputStream-->String

String inputStream2String(InputStream is) {
    BufferedReader in = new BufferedReader(new InputStreamReader(is));
    StringBuffer buffer = new StringBuffer();
    String line = "";
    try {
        while ((line = in.readLine()) != null) {
            buffer.append(line);
        }
    } catch (IOException e) {
        e.printStackTrace();
    }
    return buffer.toString();
}

base64-->String

String result = "abc";

byte[] encodeRes = Base64.decode(result, Base64.DEFAULT);

String res = new String(encodeRes);

String-->base64

 

Base64.encodeToString(str.getBytes(), Base64.DEFAULT);

 

char[]-->jstring

jstring jstr;
char str[]="Hello World/n";
jstr=env->NewStringUTF(str);
return jstr;

 

 

 

 

相关文章:

  • 2021-08-30
  • 2021-11-28
  • 2022-12-23
  • 2022-01-08
  • 2021-10-05
  • 2022-01-16
  • 2021-06-16
  • 2021-10-24
猜你喜欢
  • 2022-02-07
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-30
  • 2021-05-12
相关资源
相似解决方案