Here you can find the source of GetRawView(String string)
public static String GetRawView(String string)
//package com.java2s; //License from project: Open Source License import java.util.Formatter; public class Main { public static String GetRawView(String string) { byte[] bytes = string.getBytes(); StringBuilder sb = new StringBuilder(); Formatter formatter = new Formatter(); for (int i = 0; i < bytes.length; i++) { String raw = Integer.toString((bytes[i] & 0xff) + 0x100, 16).substring(1); sb.append(raw.toUpperCase()); if (i != (bytes.length - 1)) { sb.append("-"); }/*ww w. j av a2s . c o m*/ } return sb.toString(); } }