A股上市公司传智教育(股票代码 003032)旗下技术交流社区北京昌平校区

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();
                       
        }

0 个回复

您需要登录后才可以回帖 登录 | 加入黑马