Android Byte Array to String Convert getStringForByte(byte[] bs)

Here you can find the source of getStringForByte(byte[] bs)

Description

get String For Byte

License

Apache License

Declaration

public static String getStringForByte(byte[] bs) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.io.UnsupportedEncodingException;

public class Main {
    public static String getStringForByte(byte[] bs) {
        if (bs == null)
            return "";
        try {/*from  ww w  .  jav a  2 s  . co m*/
            return new String(bs, "UTF-8");
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }
        return "";
    }
}

Related

  1. fromBytes(byte[] buf)
  2. fromBytes(byte[] buf, int off, int len)
  3. bytes2String(byte[] value)
  4. byte2String(byte[] is)
  5. loadConvert(byte[] s, int offset, boolean lengthFlag)
  6. fromBytes(byte abyte0[])
  7. toString(byte[] b, int start, int end)
  8. Bcd2Str(byte[] b)
  9. ByteArrayToString(byte[] input)