Convert Base64 String to Byte Value String in Java -


The string, which is 'AAC', is equal to 3 bytes (0000000000000000000010) in binary.

I convert 'AAAC' to some output like '000002' in ASCII hex byte string Want to do

I have tried down.

  byte [] test = base64.d.dode (data.getBytes ()); Stringbilder sb = new stringbiller (); (Byte b: exam) {sb.append (string format ("% 02X", b)); } System.out.println (sb.toString ()); // output: 00 00 02  

This works, but is there a more effective method to do this?

Any help would be appreciated. thank you in advanced.

You can use classes for:

  string Results = Datatype Converter. PrintHxby (Datatype Converter. ParseBase64Binary ("AAC"); Println (results);  

Print: 000002


Comments