1  /*
  2   *  File:  BufferedTextInputTest.java
  3   *
  4   *  Buffered character stream input with BufferedReader classes
  5   *
  6   *  Copyright:  Northeast Parallel Architectures Center
  7   *  
  8   */
  9  
 10  import java.io.IOException;
 11  import java.io.FileReader;
 12  import java.io.BufferedReader;
 13  
 14  public class BufferedTextInputTest {
 15  
 16    public static void main( String args[] ) throws IOException {
 17    
 18      String line;  // for input
 19  
 20      String filename = "API.list";
 21      
 22      BufferedReader in =
 23        new BufferedReader( 
 24          new FileReader( filename ) );  // a character stream
 25      
 26      System.out.println( "Reading..." );
 27      while ( ( line = in.readLine() ) != null ) {
 28        System.out.println( line );
 29      }
 30      
 31      in.close();
 32      
 33    }
 34    
 35  }