Java UTF String Create newUTF8String(byte[] bytes)

Here you can find the source of newUTF8String(byte[] bytes)

Description

new UTF String

License

Open Source License

Declaration

public static String newUTF8String(byte[] bytes) 

Method Source Code


//package com.java2s;
import java.io.UnsupportedEncodingException;

public class Main {
    public static String newUTF8String(byte[] bytes) {
        try {/*  ww w. jav  a 2 s.  c o m*/
            return new String(bytes, "UTF-8");
        } catch (UnsupportedEncodingException e) {
            throw new RuntimeException(e);
        }
    }
}