Created
February 26, 2014 01:08
-
-
Save anonymous/9221440 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void backupFile() | |
{ | |
DataInputStream in = null; | |
DataOutputStream out = null; | |
try { | |
in = new DataInputStream(new FileInputStream(f1)); | |
out = new DataOutputStream(new FileOutputStream(fBackup)); | |
try { | |
while (true) { | |
Byte dataIn = in.readByte(); | |
out.writeByte(dataIn); | |
} | |
} catch (IOException e) { | |
System.out.println("Finished backing up"); | |
// e.printStackTrace(); | |
} | |
} catch (FileNotFoundException e) { | |
// TODO Auto-generated catch block | |
e.printStackTrace(); | |
} finally { | |
try { | |
in.close(); | |
out.close(); | |
} catch (IOException e) { | |
// TODO Auto-generated catch block | |
e.printStackTrace(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment