b = bytearray("test", encoding="utf-8")
# here test is encoded into a byte array
str1 = bytes(b)
# the function bytes decodes it for us !!!
print(str1)
#thank god for python
byte[] byteArray1 = { 80, 65, 78, 75, 65, 74 };
String str = new String(byteArray1, 0, 3, StandardCharsets.UTF_8);
b = bytearray("test", encoding="utf-8") str1 = bytes(b) print(str1)