📄 memerystream1.java
字号:
import java.io.*;
class MemeryStream1
{
public static void main(String args[])
{
String s="abcdefghijklmnopqrstuvwxyz";
byte src[]=s.getBytes();//src为转换前的内存块
ByteArrayInputStream in = new ByteArrayInputStream(src);
ByteArrayOutputStream out = new ByteArrayOutputStream();
transform(in,out);
byte result[]=out.toByteArray();//result为转换后的内存块
String t=new String(result);
System.out.println(t);
}
public static void transform(InputStream in,OutputStream out)
{
int c;
try
{
while((c=in.read())!=-1)
{
c=Character.toUpperCase((char)c);
out.write(c);
}
}
catch(Exception e)
{
e.printStackTrace();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -