MCPcopy
hub / github.com/DuGuQiuBai/Java / main

Method main

day20/code/day20_IO/src/cn/itcast_03/CopyFileDemo2.java:15–31  ·  view source on GitHub ↗
(String[] args)

Source from the content-addressed store, hash-verified

13 */
14public class CopyFileDemo2 {
15 public static void main(String[] args) throws IOException {
16 // ��װ����Դ
17 // java.io.FileNotFoundException: c:\a.txt (ϵͳ�Ҳ���ָ�����ļ���)
18 FileInputStream fis = new FileInputStream("c:\\a.txt");
19 // ��װĿ�ĵ�
20 FileOutputStream fos = new FileOutputStream("d:\\b.txt");
21
22 // �����
23 int by = 0;
24 while ((by = fis.read()) != -1) {
25 fos.write(by);
26 }
27
28 // �ͷ���Դ
29 fos.close();
30 fis.close();
31 }
32}

Callers

nothing calls this directly

Calls 3

readMethod · 0.45
writeMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected