⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 testwriter.java

📁 这是java 字符流对象的简单比较的源码例子。希望能帮组学java的朋友
💻 JAVA
字号:
import java.io.*;

public class TestWriter {
	public static void main(String[] args) {
		FileInputStream in = null;
		FileOutputStream out = null;
		try {
			in = new FileInputStream("d:\\a.txt");
			InputStreamReader is = new InputStreamReader(in);
			out = new FileOutputStream("d:\\share\\jproject\\io\\b.txt");
			OutputStreamWriter os = new OutputStreamWriter(out);
			int b = 0;
			while((b=in.read()) != -1) {
				os.write(b);
			}
			is.close();
			os.close();
		}catch(FileNotFoundException e) {
			System.out.println("the file is not found !!!");
		}catch(IOException e) {
			System.out.println("the IO system is error!!");
		}
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -