Java tutorial
//package com.java2s; public class Main { public static String byte2hexWithoutSpace(byte[] buffer) { String h = ""; for (int i = 0; i < buffer.length; i++) { String temp = Integer.toHexString(buffer[i] & 0xFF); if (temp.length() == 1) { temp = "0" + temp; } h = h + temp; } return h; } }