Here you can find the source of ConvertHexByteArrayToString( byte[] byteArrayToConvert)
public static String ConvertHexByteArrayToString( byte[] byteArrayToConvert)
//package com.java2s; //License from project: Open Source License public class Main { public static String ConvertHexByteArrayToString( byte[] byteArrayToConvert) { String ConvertedByte = ""; for (int i = 0; i < byteArrayToConvert.length; i++) { if (byteArrayToConvert[i] < 0) { ConvertedByte += Integer.toString( byteArrayToConvert[i] + 256, 16) + " "; } else if (byteArrayToConvert[i] <= 15) { ConvertedByte += "0" + Integer.toString(byteArrayToConvert[i], 16) + " "; } else { ConvertedByte += Integer .toString(byteArrayToConvert[i], 16) + " "; }// ww w .j av a2 s.c o m } return ConvertedByte; } }