日期:2014-05-20 浏览次数:20845 次
package mypackage;
import java.io.*;
public class FileReaderSimple {
public static void main(String[] args) throws IOException
{
FileInputStream in = new FileInputStream("E:\\note\\20130614.txt");
/* int data;
while((data=in.read())!=-1)
System.out.println(data);*/
try{
BufferedInputStream bIn=new BufferedInputStream(in);
DataInputStream dIn=new DataInputStream(bIn);
System.out.print(dIn.readUTF().toString());
dIn.close();
bIn.close();
}
catch(EOFException e)
{
e.printStackTrace();
}
in.close();
}
}