You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
932 B
932 B
java
package step4;
import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.FileReader; import java.io.FileWriter; import java.io.IOException;
public class Task {
public void task() throws IOException{
/********* Begin *********/
FileReader fr = new FileReader("src/step4/input/input.txt");
FileWriter fw = new FileWriter("src/step4/output/output.txt");
int len = 0;
char[] cbuf = new char[1024];
while ((len = fr.read(cbuf))!=-1)
{
fw.write(cbuf,0,len);
}
fr.close();
fw.flush();
fw.close();
FileInputStream fs = new FileInputStream("src/step4/input/input.jpg");
FileOutputStream fos = new FileOutputStream("src/step4/output/output.jpg");
int le = 0;
byte[] bt = new byte[1024];
while ((le = fs.read(bt))!=-1)
{
fos.write (bt,0,le);
}
fs.close();
fos.flush();
fos.close();
/********* End *********/
}
}