使用BufferedInputStream读取文件
import java.io.BufferedInputStream;/** from nowjava.com - 时代Java**/ import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; public class Main { public static void main(String[] args) { File file = new File("C://Folder//ReadFile.txt"); BufferedInputStream bin = null; try { FileInputStream fin = new FileInputStream(file); bin = new BufferedInputStream(fin); while (bin.available() > 0) { System.out.print((char) bin.read()); } } catch (FileNotFoundException e) { System.out.println("File not found" + e); } catch (IOException ioe) { System.out.println("Exception while reading the file " + ioe); /*来自 N o w J a v a . c o m*/ } finally { try {