Here you can find the source of copyBytesToString(byte[] src, int arg1, int arg2)
public static String copyBytesToString(byte[] src, int arg1, int arg2)
//package com.java2s; //License from project: Open Source License public class Main { public static String copyBytesToString(byte[] src, int arg1, int arg2) { char[] chrs = new char[arg2 - arg1]; for (int i = 0, j = arg1; j < arg2; i++, j++) { chrs[i] = (char) src[j]; }//from w ww.jav a2 s .co m String s = String.valueOf(chrs); return s; } }