// Read space-delimited file of integers // Convert from ASCII to internal binary ... BufferedReader in = new BufferedReader(new FileReader( "C:\\temp\\foo.in" ), 4096 /* buffsize */ ); String aLine = in.readLine(); StringTokenizer st = new StringTokenizer(aLine); // process one line worth of space-delimited integers while ( st.hasMoreTokens() ) { String s = st.nextToken(); int i = Integer.parseInt(s); out.println(i); } // end while