Alternative of DatatypeConverter.printHexBinary(byte[] array) and DatatypeConverter.parseHexBinary(String str) in Android

喜你入骨 提交于 2019-12-10 12:47:29

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!