Here you can find the source of toHexString(byte[] buf)
http://homepage2.nifty.com/igat/igapyon/diary/2002/ig021213.html
Parameter | Description |
---|---|
buf | a parameter |
private static String toHexString(byte[] buf)
//package com.java2s; //License from project: Open Source License public class Main { /**// w w w. java2 s . c om * http://homepage2.nifty.com/igat/igapyon/diary/2002/ig021213.html * @param buf * @return Return Hex String Value. */ private static String toHexString(byte[] buf) { String s = ""; for (int i = 0; i < buf.length; i++) { int n = buf[i] & 0xff; if (n < 16) { s += " 0"; } else { s += " "; } s += Integer.toHexString(n).toUpperCase(); } return s; } }