// // File: /home/cs255001/demo/atoi/JavaInput_1.java // // Demo reading input WITHOUT using Scanner utility class !!!! // public class JavaInput_1 { public static void main(String[] args) throws Exception { byte[] b = new byte[100]; int count; while ( true ) { System.out.print("Enter input: "); count = System.in.read(b); // Read from key board System.out.println("# characters read = " + count); for (int i = 0; i < count; i++) { System.out.println(b[i]); // System.out.println(String.format("%x", b[i]) ); // Print in Hex } System.out.println("\n"); } } }