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

 找回密码
 加入黑马

QQ登录

只需一步,快速开始

© 官珺伟 高级黑马   /  2014-4-27 12:04  /  815 人查看  /  3 人回复  /   1 人收藏 转载请遵从CC协议 禁止商业使用本文

package day17;
import java.io.*;
public class CopyMp3 {

        /**
         * @param args
         */
        public static void main(String[] args)throws Exception {
                // TODO Auto-generated method stub
                BufferedInputStream bufis=
                        new BufferedInputStream(new FileInputStream("e:/KuGou/张信哲 - 从开始到现在.mp3"));
                BufferedOutputStream bufos=
                        new BufferedOutputStream(new FileOutputStream("d:/a/1.mp3"));
               
                int by=0;
                while((by=bufis.read())!=-1)
                {
                        bufos.write(by);
                }
                bufos.close();
                bufis.close();

        }

}


3 个回复

倒序浏览
没问题啊!怎么了!
回复 使用道具 举报
"e:/KuGou/张信哲 - 从开始到现在.mp3
java里面要使用//才可以。
"e://KuGou//张信哲 - 从开始到现在.mp3

点评

e:\\KuGou\\张信哲 - 从开始到现在.mp3" is ok  发表于 2014-4-27 16:09
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 加入黑马