IO操作変更標準入出力フローと変換フロー練習
950 ワード
/*
*
*
* Copyright (c) 2011,
* All rights reserved.
* :
* :
* :2012 11 06
* :x1.0
*
* :
* :
* :
*
*/
import java.io.*;
class TransStreamTest2
{
public static void main(String[] args) throws IOException
{
System.setIn(new FileInputStream("TransStreamTest.java"));
System.setOut(new PrintStream("zzz.txt"));
BufferedReader bufr = new BufferedReader(new InputStreamReader(System.in));
BufferedWriter bufw = new BufferedWriter(new OutputStreamWriter(System.out));
String line = null;
while((line = bufr.readLine()) != null)
{
if("over".equals(line))
break;
bufw.write(line.toUpperCase());
bufw.newLine();
bufw.flush();
}
bufr.close();
}
}