Byte Array To String - Android File Input Output

Android examples for File Input Output:Byte Array Convert

Description

Byte Array To String

Demo Code


//package com.book2s;

public class Main {
    public static String ByteArrayToString(byte[] arr) {
        StringBuffer sb = new StringBuffer();
        for (byte item : arr) {
            sb.append(String.format("%02X ", item & 0xFF));
        }//from   ww  w  .ja  va  2  s .co m

        return "{ " + sb.toString() + "}";
    }
}

Related Tutorials