-
Notifications
You must be signed in to change notification settings - Fork 3
/
Hello.java
28 lines (26 loc) · 1.01 KB
/
Hello.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package Hello;
import java.io.*;
public class Hello{
public static void main(String[] args) {
BufferedOutputStream writer = null;
try {
Thread.sleep(10000);
writer = new BufferedOutputStream(new FileOutputStream("hello.txt"));
for (int j = 0; j < 10000; j++) {
writer.write(String.valueOf(j).getBytes());
writer.write("\n".getBytes());
writer.flush();
}
} catch (Exception e) {
e.printStackTrace();
} finally {
if (writer != null) {
try {
writer.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
}