IOException
import java.io.IOException;
// 키보드로 입력받은 원시데이터(1Byte)를 모니터로 전달하여 출력하는 프로그램 작성
// => EoF(End of File) 신호(Ctrl + Z - 입력종료)를 받기 전까지 반복 처리
public class ByteStreamApp {
public static void main(String[] args) throws IOException {
System.out.println("[메세지] 키보드를 눌러 문자값을 입력해 주세요.");
// 키보드 입력값(1Byte - 원시데이터)을 저장하기 위한 변수
int readByte;
while(true){
readByte = System.in.read();
// 입력종료신호(Ctrl + Z : -1)를 전달된 경우 반복문 종료
if(readByte == -1) break;
/
System.out.write(readByte);
}
System.out.println("[메세지] 프로그램을 종료합니다.");
}
}