Java tutorial
//package com.java2s; public class Main { public static String convertByteArrayToHex(byte[] bytes) { if (bytes == null) { return null; } StringBuilder sb = new StringBuilder(); for (byte b : bytes) { sb.append(String.format("%02X", b)); } return sb.toString(); } }