复制代码
- //:TestEOF.java
- //Testingfortheendoffilewhilereading
- //abyteatatime.
- importjava.io.*;
- publicclassTestEOF{
- publicstaticvoidmain(String[]args){
- try{
- DataInputStreamin=
- newDataInputStream(
- newBufferedInputStream(
- newFileInputStream("TestEof.java")));
- while(in.available()!=0)
- System.out.print((char)in.readByte());
- }catch(IOExceptione){
- System.err.println("IOException");
- }
- }
- }///:~
欢迎光临 仓酷云 (http://www.ckuyun.com/) | Powered by Discuz! X3.2 |