package ch05;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
public class InputStreamReaderTest {
public static void main(String[] args) {
// try(FileInputStream fi = new FileInputStream("assets/input2.txt")){ 읽고 쓰는건 메인기반스트림만
try(InputStreamReader isr = new InputStreamReader(new FileInputStream("assets/input2.txt"))){
//보조는 읽고 쓰기가 안됨 (이렇게쓰면 보조기반을 한꺼번에 쓸수있다.)
int i;
while((i= isr.read())!= -1) {
System.out.print((char)i);
}
}catch (IOException e) {
System.out.println(e);
}
}
}