Here you can find the source of getString(byte[] fromBytes, int offset, int length)
public static String getString(byte[] fromBytes, int offset, int length)
//package com.java2s; //License from project: Open Source License import java.io.UnsupportedEncodingException; public class Main { public static final String BYTE_CHARSET = "UTF-8"; public static String getString(byte[] fromBytes, int offset, int length) { final String toString; try {//from w w w . j av a 2 s .c o m toString = new String(fromBytes, offset, length, BYTE_CHARSET); } catch (UnsupportedEncodingException e) { throw new RuntimeException(e); } return toString; } }