java bytes转hex string

import org.apache.commons.codec.binary.Hex;

String foo = "I am a string";
byte[] bytes = foo.getBytes();
System.out.println( Hex.encodeHexString( bytes ) );
posted @ 2022-11-11 19:30  公众号python学习开发  阅读(35)  评论(0编辑  收藏  举报