1 package hjw;
2 import java.io.ByteArrayInputStream;
3 import java.io.ByteArrayOutputStream;
4 import java.io.IOException;
5 //import org.omg.CORBA_2_3.portable.OutputStream;
6 public class dm {
7 public static void main(String[] args) throws Exception {
8 String str="HELLOWORLD";
9 ByteArrayInputStream bis=new ByteArrayInputStream(str.getBytes());
10 ByteArrayOutputStream bos=new ByteArrayOutputStream();
11 int temp=0;
12 while((temp=bis.read())!=-1){
13 char c=(char) temp;
14 bos.write(Character.toLowerCase(c));
15 }
16 String newStr=bos.toString();
17 try{
18 bis.close();
19 bos.close();
20 }catch (IOException e){
21 e.printStackTrace();
22 }
23 System.out.println(newStr);
24 }
25 }
26
完成了大写字母装换成小写字母、、、