Here you can find the source of toUTF8String(byte[] b, int offset, int length)
public static String toUTF8String(byte[] b, int offset, int length)
//package com.java2s; //are made available under the terms of the Eclipse Public License v1.0 import java.io.UnsupportedEncodingException; public class Main { public final static String __UTF8 = "UTF-8"; public static String toUTF8String(byte[] b, int offset, int length) { try {// ww w . j av a 2 s . c om return new String(b, offset, length, __UTF8); } catch (UnsupportedEncodingException e) { throw new IllegalArgumentException(e); } } }