Java tutorial
//package com.java2s; //License from project: Open Source License public class Main { public static String bytesRangeToString(byte[] bytes, int from, int to) { StringBuilder stringBuilder = new StringBuilder(); for (int i = from; i <= to; i++) stringBuilder.append((char) bytes[i]); return stringBuilder.toString(); } }