Java examples for File Path IO:ByteArrayInputStream
Read byte array using ByteArrayInputStream
import java.io.ByteArrayInputStream; public class Main { public static void main(String[] args) { String str = "this is a test Example!"; byte[] bytes = str.getBytes(); ByteArrayInputStream bai = new ByteArrayInputStream(bytes); int ch;/*from www .j a v a2 s . co m*/ while ((ch = bai.read()) != -1) { System.out.print((char) ch); } } }