(String[] args)
| 15 | */ |
| 16 | public class CopyFileDemo { |
| 17 | public static void main(String[] args) throws IOException { |
| 18 | // ��װ���� |
| 19 | FileInputStream fis = new FileInputStream("a.txt"); |
| 20 | // ��װĿ�ĵ� |
| 21 | FileOutputStream fos = new FileOutputStream("b.txt"); |
| 22 | |
| 23 | // �����ݣ�д���� |
| 24 | int by = 0; |
| 25 | while ((by = fis.read()) != -1) { |
| 26 | fos.write(by); |
| 27 | } |
| 28 | |
| 29 | // �ͷ���Դ |
| 30 | fos.close(); |
| 31 | fis.close(); |
| 32 | } |
| 33 | } |