/* * File: TextInputTest.java * * Character stream input with Reader classes * * Copyright: Northeast Parallel Architectures Center * */ import java.io.IOException; import java.io.RandomAccessFile; public class TextInputTest { public static void main( String args[] ) throws IOException { String line; // for input String filename = "TextIOTest.dat"; RandomAccessFile in = new RandomAccessFile( filename, "r" ); System.out.println( "Reading..." ); while ( ( line = in.readLine() ) != null ) { System.out.println( line ); } in.close(); } }