import java.io.FileInputStream;
import java.io.FileNotFoundException;

public class ReadAndPrint {
    
public static final int BUFSIZE = 1024;

    
public static void main(String[] args) {
        
byte[] buffer = new byte[BUFSIZE]; // 定义一byte类型的缓冲区。
        FileInputStream fin = null;

        
boolean flag = true;
        
try {
            fin 
= new FileInputStream("c://test.ini");
        }
 catch (FileNotFoundException e) {
            e.printStackTrace();
        }

        
while (flag) {
            
try {
                
int nn = fin.read(buffer);
                System.out.write(buffer, 
0, nn);
            }
 catch (Exception e) {
                flag 
= false;
            }

        }

    }

}