Here you can find the source of decode(String bytes)
public static String decode(String bytes)
//package com.java2s; //License from project: Apache License import java.io.ByteArrayOutputStream; public class Main { private static String hexString = "0123456789ABCDEF"; public static String decode(String bytes) { ByteArrayOutputStream baos = new ByteArrayOutputStream(bytes.length() / 2); for (int i = 0; i < bytes.length(); i += 2) baos.write(hexString.indexOf(bytes.charAt(i)) << 4 | hexString.indexOf(bytes.charAt(i + 1))); return new String(baos.toByteArray()); }//from ww w .j a v a 2 s. c o m }