Convert byte array to UTF8 String - Android java.lang

Android examples for java.lang:String UTF-8

Description

Convert byte array to UTF8 String

Demo Code

import android.content.Context;
import android.content.res.AssetManager;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.util.Log;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Main{

    public static String byte2String(byte[] is) throws Exception {
        String srt = new String(is, "UTF-8");
        return srt;
    }/*from   ww  w  . j a  v a 2 s  .  c  om*/

}

Related Tutorials