【Java】读写操作

 1 package pers.stresm;
 2 
 3 import java.io.FileInputStream;
 4 import java.io.FileOutputStream;
 5 
 6 /**
 7  *     读写操作
 8  * @author three
 9  *
10  */
11 public class ReadIn {
12 
13     public static void main(String[] args) {
14         try {
15             FileInputStream in = new FileInputStream("F:/Hello.java");    //要读取的文件位置
16             FileOutputStream out = new FileOutputStream("F:/abc.txt",true);    //需要写入的位置,true表示不覆盖
17             
18             out.write(in.readAllBytes());    //文件之间写入
19             out.write("205024319".getBytes()); //直接写入
20             
21             in.close();
22             out.close();
23         } catch (Exception e) {
24             // TODO Auto-generated catch block
25             e.printStackTrace();
26         }
27     }
28 
29 }
原文地址:https://www.cnblogs.com/netyts/p/13751773.html