Update README.md

main
psckwxi8l 2 years ago
parent 4b76a501a0
commit c5a5a887d6

@ -1,2 +1,41 @@
# 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 *********/
}
}

Loading…
Cancel
Save