tag:blogger.com,1999:blog-8712770457197348465.post7119554413190470800..comments2024-03-29T03:17:04.645-07:00Comments on Javarevisited: How to Convert and Print Byte array to Hex String in Java? Examplejavin paulhttp://www.blogger.com/profile/15028902221295732276noreply@blogger.comBlogger4125tag:blogger.com,1999:blog-8712770457197348465.post-78239051471612508122016-02-24T06:54:39.107-08:002016-02-24T06:54:39.107-08:00thanks man.. it helped a lot..thanks man.. it helped a lot..sandeephttps://www.blogger.com/profile/05179243285007479795noreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-57592491474763996412014-03-12T13:53:51.484-07:002014-03-12T13:53:51.484-07:00BigInteger(bytes).toString(16) won't work as i... BigInteger(bytes).toString(16) won't work as it will drop leading zerosAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-63003938077187527502013-04-02T16:32:48.137-07:002013-04-02T16:32:48.137-07:00@Wouter That BigInt trick is a good one:
new BigI...@Wouter That BigInt trick is a good one:<br /><br />new BigInteger("testing $0002)--?!".getBytes()).toString(16)<br /><br />new String(new BigInteger("74657374696e67202430303032292d2d3f21", 16).toByteArray())Ashwin Jayaprakashhttps://www.blogger.com/profile/14487665820971997426noreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-41133877445254545672013-04-02T01:11:37.533-07:002013-04-02T01:11:37.533-07:00This also works, is short, and does not require an...This also works, is short, and does not require an external library:<br />new BigInteger(bytes).toString(16)Wouter Coekaertshttps://www.blogger.com/profile/13237153654158543038noreply@blogger.com