Hi,
can anyone tell me why the third test fails. At my machine it works.
Best regards
Steffen Neumann
package de.codegym.task.task09.task0929;
import javax.crypto.CipherOutputStream;
import java.io.*;
import java.io.FileInputStream;
import java.io.FileOutputStream;
/*
Sorgen wir dafür, dass der Code etwas nützliches macht!
*/
public class Solution {
public static class Debug{
public static boolean debug = false;
}
public static void main(String[] args) throws IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
System.out.println("give the path to file a");
String quelldateiName = reader.readLine();
System.out.println("give the path to file b");
String zieldateiName = reader.readLine();
InputStream fileInputStream = null;
try {
fileInputStream = getInputStream(quelldateiName);
if(Debug.debug){
System.out.println(fileInputStream);
}
}catch(Exception e){
System.out.println(e);
}
OutputStream fileOutputStream = null;
try{
fileOutputStream = getOutputStream(zieldateiName);
if(Debug.debug){
System.out.println(fileOutputStream);
}
}catch(Exception e){
System.out.println("Datei ist nicht vorhanden");
}
int data;
while (fileInputStream.available() > 0){
data = fileInputStream.read();
fileOutputStream.write(data);
}
fileInputStream.close();
fileOutputStream.close();
}
public static InputStream getInputStream(String dateiname) throws IOException {
return new FileInputStream(dateiname);
}
public static OutputStream getOutputStream(String dateiname) throws IOException {
return new FileOutputStream(dateiname);
}
}