forked from teddyzhang1976/ThinkInJava4thSampleCode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestEOF.java
More file actions
15 lines (14 loc) · 463 Bytes
/
TestEOF.java
File metadata and controls
15 lines (14 loc) · 463 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//: io/TestEOF.java
package io; /* Added by Eclipse.py */
// Testing for end of file while reading a byte at a time.
import java.io.*;
public class TestEOF {
public static void main(String[] args)
throws IOException {
DataInputStream in = new DataInputStream(
new BufferedInputStream(
new FileInputStream("TestEOF.java")));
while(in.available() != 0)
System.out.print((char)in.readByte());
}
} /* (Execute to see output) *///:~