字元輸入流
package com.zhidi.lianxi2;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
public class Zifushuru {
public static void main(String [] args) throws IOException{
InputStreamReader in = new InputStreamReader(new FileInputStream("E:\\abc.txt"));
int i;
String s="";
while((i=in.read())!=-1){
s=s+(char)i;
}
System.out.println(s);
in.close();
}
}