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章;
标签:2020.8,String,java,第二十七,io,output,import,public 来源: https://www.cnblogs.com/Nojava/p/13420118.html