📄 inputstreamtest.java
字号:
import java.io.*;
public class InputStreamTest
{
public static void main(String[] args)
{
int b;
byte buffer[]=new byte[2500];
try
{
File f=new File("C:\\java测试及练习\\","InputStreamTest.java");
FileInputStream file=new FileInputStream(f);
b=file.read(buffer,0,2500);
try
{
String str=new String(buffer,0,b,"Default");
System.out.println(str);
}
catch(UnsupportedEncodingException e)
{System.out.println("the encoding was not found:"+e);}
}
catch(IOException e)
{System.out.println("File read Error");}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -