1. package cn.lxl.input;  
  2.  
  3. import java.io.File;  
  4. import java.io.FileInputStream;  
  5. import java.io.IOException;  
  6. import java.io.InputStream;  
  7.  
  8. public class InputTest1 {  
  9.     public static void main(String[] args) throws IOException {  
  10.         File file = new File("d:/test.txt");  
  11.         InputStream is = new FileInputStream(file);  
  12.  
  13.         byte[] buffer = new byte[200];  
  14.         int length = 0;  
  15.         while (-1 != (length = (is.read(buffer, 0200)))) {  
  16.             String str = new String(buffer, 0, length);  
  17.             System.out.println(str);  
  18.         }  
  19.         is.close();  
  20.     }  
  21. }