Here you can find the source of toHexBytes(byte[] bytes)
Parameter | Description |
---|---|
bytes | The bytes |
public static String toHexBytes(byte[] bytes)
//package com.java2s; //License from project: Open Source License public class Main { /**/*from w w w . ja v a 2s .com*/ * @param bytes The bytes * * @return A string representation of the bytes in hex */ public static String toHexBytes(byte[] bytes) { StringBuilder buffer = new StringBuilder(); for (byte b : bytes) { buffer.append(String.format(" %02x", b)); } return buffer.toString(); } }