Created
January 30, 2015 12:06
-
-
Save OlgaKulikova/6ff2627a8aee8c73618f to your computer and use it in GitHub Desktop.
Copy file
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 class Solution | |
{ | |
public static void main(String[] args) throws IOException | |
{ | |
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); | |
String sourceFileName = reader.readLine(); | |
String destinationFileName = reader.readLine(); | |
java.io.FileInputStream fileInputStream = new java.io.FileInputStream(sourceFileName); | |
java.io.FileOutputStream fileOutputStream = new java.io.FileOutputStream(destinationFileName); | |
int count = 0; | |
while (fileInputStream.available()>0) | |
{ | |
int data = fileInputStream.read(); | |
fileOutputStream.write(data); | |
count++; | |
} | |
System.out.println("Скопировано байт " + count); | |
fileOutputStream.close(); | |
fileInputStream.close(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment