Android Byte Array to String Convert getString(byte[] value)

Here you can find the source of getString(byte[] value)

Description

get String

Declaration

public static String getString(byte[] value)
   

Method Source Code

//package com.java2s;

public class Main {
    public static String getString(byte[] value) {
        StringBuilder stringBuilder = new StringBuilder("");
        for (int i = 0; i < value.length; i++) {
            int v = value[i] & 0xFF;
            String hv = Integer.toHexString(v);
            if (hv.length() < 2) {
                stringBuilder.append(0);
            }//from w  ww . j av a 2  s .c  om
            stringBuilder.append(hv);
        }
        return stringBuilder.toString();
    }
}

Related

  1. getString(byte[] bb)
  2. getString(byte[] bytes)
  3. getString(byte[] bytes, String charsetName)
  4. getString(byte[] fromBytes, int offset, int length)
  5. getString(byte[] originalByte, int start, int length)
  6. getStringByByteArray(byte[] b)
  7. toByteString(byte[] bytes)
  8. toByteString(byte[] bytes, int start, int length)
  9. convertBytesToString(byte[] value)