I have a Bytestring that I need to display to the console in java.
The Bytestring is of type com.google.protobuf.ByteString,
I am using:
System.out.println(myByteString);
however, when it is printed out in the terminal it is in this form:
\n\325\a\nk\b\003\032\v\b\312\371\336\343\005\020\254\200\307S\
How can I display the string in ASCII characters instead of this encoding?
I have tried using System.out.println(myByteString.toString());
Thanks
Try
System.out.println(myByteString.toString("UTF-8"));
or whatever encoding you are using.
Check out this link: Google Developers: Class ByteString
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With