public static void copy_4(String s1,String s2)throws IOException//这里的分割当真巧妙
{
FileInputStream fi=new FileInputStream(s1);
FileOutputStream fo=null;//关键在这里
int len=0;
int count=0;
byte[] buf=new byte[1024*1024];
while((len=fi.read(buf))!=-1)
{
fo=new FileOutputStream(s2+count+++".mp3");
fo.write(buf,0,len);
fo.close();
}
fi.close();
} |
|