public static String bytesToHexString(byte[] bytes) {
        if (bytes == null) {
            return null;
        }
        String table = "0123456789abcdef";
        StringBuilder ret = new StringBuilder(2 * bytes.length);

        for (byte c : bytes) {
            int b;
            b = 0x0f & (c >> 4);
            ret.append(table.charAt(b));
            b = 0x0f & c;
            ret.append(table.charAt(b));
        }

        return ret.toString();
    }
Converts a byte array into a String hexidecimal characters in lower case

null returns null
replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/replugin/utils/basic/ByteConvertor.java