private static String bytesToString(byte[] encrypted) {
//above method converts bytes to string
String test = "";
for (byte b : encrypted) {
test += Byte.toString(b);
}
return test;
}
I have this method that converts bytes to String. How can I modify it so that it can convert the String to bytes?