本帖最后由 杨兴庭 于 2013-8-2 19:03 编辑
public static void main(String[] args) throws IOException
{
BufferedReader bufr = new BufferedReader(new InputStreamReader(System.in));
BufferedWriter bufw = new BufferedWriter(new OutputStreamWriter(System.out));//----------------------------------问题是OutputStreamWriter是字符流转向字节流的桥梁,那么这里在
//----------------------------------存入的时候不就已经是字节了吗。但怎么就是字符流了呢?
String line = null;
while((line=bufr.readLine())!=null)
{
if("over".equals(line))
break;
bufw.write(line.toUpperCase());
bufw.newLine();
bufw.flush();
}
bufr.close();
}
|