/* Reads and displays bytes until end-of-file. Reads from the keyboard * or from a file name entered as a program argument. */ import java.io.*; public class ReadBytes { public static void main(String[] args) { InputStream input; try { if (args.length == 1) input = new FileInputStream(args[0]); else input = System.in; int i; while((i = input.read()) != -1) System.out.print(i + " "); input.close(); }catch(IOException e) { e.printStackTrace(); } } }