Import Java.io.FileInputStream;
Import Java.io.FileOutputStream;
Import java.io.IOException;
public class CopyFile {
/**
* @param args
*/
public static void Main (string[] args) {
try {
FileInputStream fis = new FileInputStream ("A.mp3");
FileOutputStream fos = new FileOutputStream ("Temp.mp3");
int read = Fis.read ();
byte[] buf = new byte[1024];
int len = 0;
while ((Len=fis.read (BUF))! =-1) {
Fos.write (Buf,0,len);
Read = Fis.read ();
}
Fis.close ();
Fos.close ();
} catch (IOException e) {
E.printstacktrace ();
}
}
}
Through this work, mainly to the code to add
byte[] buf = new byte[1024];
int len = 0; This code can increase the read byte speed
It then modifies the contents of the following loop:
while ((Len=fis.read (BUF))! =-1) {
Fos.write (Buf,0,len);
After the modification is finished, the speed of reading the song becomes less than 2 seconds in the original half, and the test is successful.
About improving the word throttling problem and the fourth time Java job