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