Java examples for File Path IO:Byte Array
format Bytes as String
//package com.java2s; public class Main { public static void main(String[] argv) throws Exception { byte bytes = 2; System.out.println(formatBytes(bytes)); }/*from w ww .j a va2s .c o m*/ public static String formatBytes(byte... bytes) { StringBuilder sb = new StringBuilder(bytes.length * 3); for (byte byt : bytes) { sb.append(String.format("%02X ", byt)); } return sb.toString(); } }