使用FileInputStream读取文件
import java.io.*;/**n o w j a v a . c o m**/ public class Main { public static void main(String[] args) { File file = new File("C://Folder//String.txt"); int ch; StringBuffer strContent = new StringBuffer(""); FileInputStream fin = null; try{ fin = new FileInputStream(file); while( (ch = fin.read()) != -1) strContent.append((char)ch); fin.close(); } catch(FileNotFoundException e) {//时 代 J a v a 公 众 号 - nowjava.com 提 供 System.out.println("File " + file.getAbsolutePath() + " could not be found on filesystem"); }catch(IOException ioe) { System.