Android Array to String Convert hexToString(byte[] ids)

Here you can find the source of hexToString(byte[] ids)

Description

hex To String

Declaration

public static String hexToString(byte[] ids) 

Method Source Code

//package com.java2s;

public class Main {
    public static String hexToString(byte[] ids) {
        StringBuffer id = new StringBuffer();
        for (int i = 0; i < ids.length; i++) {
            char c = (char) (((ids[i] >> 4) & 0x0f) + 0x30);
            id.append(c);//from  w ww.  j av a2 s . c  om
            c = (char) (((ids[i]) & 0x0f) + 0x30);
            id.append(c);
        }

        return id.toString();
    }
}

Related

  1. toString(int[][] iArray)
  2. toString(long[][] iArray)
  3. toString(Object[] obj)
  4. byteArrayToString(byte[] a)
  5. bytetoString(byte[] b)
  6. toString(byte[] ba)
  7. toString(byte[] ba, int offset, int length)
  8. byteToString(byte[] str)
  9. toString(byte[] buffer)