Created
March 5, 2020 09:31
-
-
Save sonOfRa/8165c904b9a1360ed09a34017ba80d7e to your computer and use it in GitHub Desktop.
This file contains hidden or 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 execute() { | |
File srcFile = new File(this.srcPath); | |
File destFile = new File(this.destPath); | |
try (InputStream inputStream = new FileInputStream(srcFile); | |
OutputStream outputStream = new FileOutputStream(destFile)){ | |
byte[] buffer = new byte[8192]; | |
int length = 0; | |
while ((length = inputStream.read(buffer)) > 0) { | |
outputStream.write(buffer, 0, length); | |
} | |
} catch (IOException ex) { | |
Logger.getLogger(NWCp.class.getName()).log(Level.SEVERE, null, ex); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment