Java examples for File Path IO:ByteArrayInputStream
How to create ByteArrayInputStream from partial array of bytes
import java.io.ByteArrayInputStream; public class Main { public static void main(String[] args) { String str = "Byte Array InputStream test"; byte[] bytes = str.getBytes(); //from ww w. jav a 2s .c o m ByteArrayInputStream bis = new ByteArrayInputStream(bytes, 5, 5); int ch; while ((ch = bis.read()) != -1) { System.out.print((char)ch); } } }