问题
what are the alternative of DatatypeConverter.printHexBinary(byte[] array)
and DatatypeConverter.parseHexBinary(String str)
in Android. Android don't have classDef of java.xml.bind.DatatypeConverter
...
回答1:
You are probably better off using the hexadecimal encoding/decoding found in the Apache commons codec library. Please make sure you are using the correct version of the library though, for more information look here
回答2:
For android (gradle) dependencies just use
implementation group: 'javax.xml.bind', name: 'jaxb-api', version: '2.2.12-b140109.1041'
implementation group: 'xerces', name: 'xercesImpl', version: '2.12.0'
来源:https://stackoverflow.com/questions/14109970/alternative-of-datatypeconverter-printhexbinarybyte-array-and-datatypeconver