📄 bufferstream1.java
字号:
import java.io.*;
class BufferStream1
{
public static void main(String args[])
{
try
{
BufferedOutputStream out=new BufferedOutputStream(new FileOutputStream("hello.txt"));
out.write("hello world中国".getBytes());
String a="ab中国";
byte b[]=a.getBytes();
System.out.print(b.length);
out.close();
}
catch(IOException e)
{
e.printStackTrace();
}
try
{
BufferedInputStream in = new BufferedInputStream(new FileInputStream("hello.txt"));
int c;
while((c=in.read())!=-1)
System.out.print((char)c);
System.out.println();
}
catch(IOException e)
{
e.printStackTrace();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -