Here you can find the source of byteArrayToHexString(byte[] byteArray)
Parameter | Description |
---|---|
byteArray | Array to be converted |
public static String byteArrayToHexString(byte[] byteArray)
//package com.java2s; public class Main { /**/*from w ww . ja va 2 s. c o m*/ * Converts a byte[] to a hex string * * @param byteArray Array to be converted * @return Array as a hex string */ public static String byteArrayToHexString(byte[] byteArray) { final StringBuilder builder = new StringBuilder(); for (byte b : byteArray) { builder.append(String.format("%02x", b)); } return builder.toString(); } }