package javaapplication1;
import java.io.ByteArrayInputStream;
import java.io.IOException;
public class JavaApplication1 {
public static void main(String[] args) throws IOException {
String s = "Java Programming";
byte[] bytes = s.getBytes();
ByteArrayInputStream bais = new ByteArrayInputStream(bytes, 5, 4);
int ch;
while((ch = bais.read()) != -1)
{
System.out.print((char)ch);
}
}
}
/*
run:
Prog
*/