its work in my lab but still give me the issue
package com.codegym.task.task09.task0929;
import java.io.*;
/*
Let's make the code do something useful!
*/
public class Solution {
public static void main(String[] args) throws IOException {
BufferedReader reader = new BufferedReader( new InputStreamReader( System.in ) );
String sourceFileName;
String destinationFileName;
InputStream fileInputStream;
OutputStream fileOutputStream;
sourceFileName = reader.readLine();
destinationFileName = reader.readLine();
try {
fileInputStream = getInputStream( sourceFileName );
fileOutputStream = getOutputStream( destinationFileName );
while (fileInputStream.available() > 0) {
int data = fileInputStream.read();
fileOutputStream.write( data );
}
fileInputStream.close();
fileOutputStream.close();
} catch (FileNotFoundException e) {
System.out.println( "File does not exist." );
} finally {
sourceFileName = reader.readLine();
fileInputStream = getInputStream( sourceFileName );
fileOutputStream = getOutputStream( destinationFileName );
while (fileInputStream.available() > 0) {
int data = fileInputStream.read();
fileOutputStream.write( data );
}
fileInputStream.close();
fileOutputStream.close();
}
}
public static InputStream getInputStream(String fileName) throws IOException {
return new FileInputStream( fileName );
}
public static OutputStream getOutputStream(String fileName) throws IOException {
return new FileOutputStream( fileName );
}
}