MCPcopy Create free account
hub / github.com/DuGuQiuBai/Java / main

Method main

day21/code/day21_IO2/Copy.java:12–32  ·  view source on GitHub ↗
(String[] args)

Source from the content-addressed store, hash-verified

10 */
11public class InputStreamReaderDemo {
12 public static void main(String[] args) throws IOException {
13 // ��������
14 InputStreamReader isr = new InputStreamReader(new FileInputStream(
15 "isr.txt"));
16
17 // һ�ζ�ȡһ���ַ�
18 // int ch = 0;
19 // while ((ch = isr.read()) != -1) {
20 // System.out.print((char) ch);
21 // }
22
23 // һ�ζ�ȡһ���ַ�����
24 char[] chs = new char[1024];
25 int len = 0;
26 while ((len = isr.read(chs)) != -1) {
27 System.out.print(new String(chs, 0, len));
28 }
29
30 // �ͷ���Դ
31 isr.close();
32 }
33}

Callers

nothing calls this directly

Calls 3

printMethod · 0.80
readMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected