Convert Byte Array To String - Android java.lang

Android examples for java.lang:Byte Array

Description

Convert Byte Array To String

Demo Code

import android.text.TextUtils;
import android.util.Log;

public class Main{

    static public String ByteArrayToString(byte[] arryByte, int nDataLength) {
        String strOut = new String();
        for (int i = 0; i < nDataLength; i++)
            strOut += String.format("%02X ", arryByte[i]);
        return strOut;
    }/*  w  w w .  j  av  a 2s. co  m*/

}

Related Tutorials