Answers for "how to convert byte[] to string in java"

2

java convert bytes to string

byte[] bytes = "hello".getBytes();
String s = new String(bytes, StandardCharsets.UTF_8);
Posted by: Guest on September-22-2020
1

java byte array to string

// string to byte[]
  byte[] bytes = "hello".getBytes(StandardCharsets.UTF_8);

  // byte[] to string
  String s = new String(bytes, StandardCharsets.UTF_8);
Posted by: Guest on January-24-2022

Code answers related to "how to convert byte[] to string in java"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language