2020.8.2第二十七天

1.今天学习内存操作流

 1 import java.io. ByteArrayInputStream;
 2 import java.io.ByteArrayOutputStream;
 3 import java.io. IOException;
 4 import java.io. InputStream;
 5 import java. io. OutputStream;
 6 public class ByteOutputStreamDemo{
 7 public static void main(String[] args) throws IOException {
 8 outin() ;
 9 }
10 public static void outin() throws IOException {
11 String info = "hello Java";
12 InputStream input =new ByteArrayInputStream (info.getBytes()) ;
13 OutputStream output = new ByteArrayOutputStream();
14 int temp = 0;
15 while ((temp - input.read()) != -1)
16 output .write (Character . toUpperCase ((char) temp)) ;
17 String str = output.toString(); 
18 input.close() ;
19 output.close() ;
20 System. out. println(str) ;
21 }
22 }

2.遇到的问题;不知道 内存怎么输入输出;

3.明天继续学习第12章;

 

posted @ 2020-08-02 19:00  敲敲代代码码  阅读(67)  评论(0编辑  收藏  举报