Java tutorial
import java.io.UnsupportedEncodingException; public class Main { public static void main(String[] argv) { byte[] bytes = new byte[] { 65, 66, 67, 68 }; try { System.out.println(new String(bytes, 1, 3, "ASCII")); } catch (UnsupportedEncodingException e) { // TODO Auto-generated catch block e.printStackTrace(); } } }