-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbyte2.txt
More file actions
52 lines (38 loc) · 1.02 KB
/
byte2.txt
File metadata and controls
52 lines (38 loc) · 1.02 KB
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
package programmers;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
public class io {
public static void main(String[] args) {
long startTime = System.currentTimeMillis();
FileInputStream fis = null;
FileOutputStream fos = null;
try {
fis = new FileInputStream("src/programmers/io.java");
fos = new FileOutputStream("byte.txt");
int readData = -1;
while((readData = fis.read()) != -1){
fos.write(readData);
}
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}finally {
try {
fos.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
try {
fis.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
long engTime = System.currentTimeMillis();
System.out.println(engTime-startTime);
}
}