package jp03.part0415.study;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.Reader;
import java.io.Writer;
public class WriterTest {
/**
* @param args
*/
public WriterTest(){
try {
Reader rd = new InputStreamReader(System.in);
Writer wr = new OutputStreamWriter(System.out);
System.out.println("입력을 기다립니다...");
while(true){
int i = rd.read();
wr.write(i);
// wr.flush();
if((char)i == 'x'){
break;
}
}
wr.flush();
rd.close();
wr.close();
} catch (Exception e) {
// TODO: handle exception
e.printStackTrace();
}
}
public static void main(String[] args) {
// TODO Auto-generated method stub
new WriterTest();
}
}
[결과]
'프로그램 > Java & Jsp' 카테고리의 다른 글
Java IO - (5) -> [FileReader] (0) | 2008.08.20 |
---|---|
Java IO - (4) -> [FileInputStream] (0) | 2008.08.20 |
Java IO - (2) -> [Reader] (0) | 2008.08.20 |
Java IO - (1) -> [InputStream] (0) | 2008.08.20 |
Beans, DTO, DAO (0) | 2008.08.18 |