Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.*;
- public class Test {
- public static void main(String[] args) throws Exception {
- BufferedInputStream inputStream = new BufferedInputStream(new FileInputStream("file.txt"));
- BufferedOutputStream outputStream = new BufferedOutputStream(new FileOutputStream("out.txt"));
- try {
- int ch;
- while ((ch = inputStream.read()) != -1) {
- outputStream.write(ch);
- }
- inputStream.close();
- outputStream.close();
- }
- catch (Exception e) {
- System.exit(1);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement