Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- *add content of one file to another
- *
- */
- public static void fileCopy (String writeTo, String writeFrom) throws IOException {
- FileInputStream fileInputStream = new FileInputStream(writeFrom);
- FileOutputStream fileOutputStream = new FileOutputStream(writeTo,true);
- byte[]buffer = new byte[(int)new File(writeFrom).length()];
- while (fileInputStream.available()>0) {
- int count = fileInputStream.read(buffer);
- fileOutputStream.write(buffer,0,count);
- }
- fileInputStream.close();
- fileOutputStream.close();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement