Q&A
Ask and answer questions to make information more available to wider audiences.
Elizabeth Jamyson @jamysonelizabeth   01, Jul 2019 12:00 AM
how to convert Byte[] array to String in Java
How convert String variable into a Byte array format, for example, JCE encryption. However how do we convert a Byte[] array to String afterward?
answers 1
 
Answer 1
Andrew Bloodgood @andrewbloodgood90   01, Jul 2019 03:18 PM
Try this

String string = "Your string";
byte[] bytes = string.getBytes(); System.out.println("Text: " + bytes.toString()); String str = new String(bytes); System.out.println("Decryted Text: " + str);