📄 ex.java~15~
字号:
package testsystem;
import java.io.*;
import java.util.*;
public class EX
{
public static void main(String arsg[])
{
try {
System.out.println("创建文件输入流对象。。。");
FileInputStream fs=new FileInputStream("E:\\input.txt");
byte data[]=new byte[200];
System.out.println("读入文件数据到指定组数中。。。");
fs.read(data);
String str=new String(data);
System.out.println(str);
Date date=new Date();
System.out.println(date.toString());
System.out.println(date);
System.out.println("创建文件输出对象。。。");
FileOutputStream fos=new FileOutputStream("E:\\output.txt");
System.out.println("将指定数组中的内容读入到文件中。。。");
fos.write(str.getBytes());
System.out.println("关闭所有文件");
fs.close();
fos.close();
} catch (Exception ex) {
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -