Character.toString(data)
This fragment should not compile because this method accepts only single character.
Use this call instead:
String.valueOf(data)
Also, new String(dataB)
is redundant. Replace it with simply dataB
0
solved Converting char to string [closed]