Here you can find the source of toHexString(String s)
public static String toHexString(String s)
//package com.java2s; //License from project: Apache License public class Main { public static String toHexString(String s) { String str = ""; for (int i = 0; i < s.length(); i++) { int ch = s.charAt(i); String s4 = Integer.toHexString(ch); str = str + s4;//from w ww.j a v a 2 s. c o m } return str; } }