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.nio.charset.StandardCharsets; public class Main { public static String toUTF8String(byte[] b, int offset, int length) { return new String(b, offset, length, StandardCharsets.UTF_8); }//from w ww . j a va2 s . c o m }