You can use the String javax.xml.bind.DatatypeConverter.printHexBinary(byte[])
. e.g.:
public static void main(String[] args) {
byte[] array = new byte[] { 127, 15, 0 };
String hex = DatatypeConverter.printHexBinary(array);
System.out.println(hex); // prints "7F0F00"
}