java bytes to string code example
Example 1: java convert bytes to string
byte[] bytes = "hello".getBytes();
String s = new String(bytes, StandardCharsets.UTF_8);
Example 2: convert byte array to string
byte[] byteArray1 = { 80, 65, 78, 75, 65, 74 };
String str = new String(byteArray1, 0, 3, StandardCharsets.UTF_8);