import java.io.FileInputStream;
import java.io.IOException;
Import the Java. IO. FileOutputStream;
Public class dome {
Public static void main (String [] args) throws IOException {
//create
FileInputStream ol=new FileInputStream (" dimo/123 JPG ");
FileOutputStream Po=new FileOutputStream (" dimo/a. pg ");
//cycle
int len;
While ((len=ol. Read ())!=1); {
Po. Write (len);
}
Ol. Close ();
Po. The close ();
}
}
CodePudding user response:
(len=ol. Read (), read the return value of this method is byte integers, but what we need is this type byte bytes, transport in the past, of course, it is not a picture, you switch to read (byte [] byte) this method, read the data to byte array, and then put the written to another file,