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

© jwseven 中级黑马   /  2015-10-23 22:47  /  372 人查看  /  0 人回复  /   0 人收藏 转载请遵从CC协议 禁止商业使用本文

public class Demo_BufferedInputStream {

        /**
         * 标准IO字节流
         * @throws IOException
         */
        public static void main(String[] args) throws IOException {
                BufferedInputStream bis = new BufferedInputStream(new FileInputStream("D:\\1024.mp4"));
                BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream("copy.mp4"));
               
                byte[] bys = new byte[1024];
                int len;
                while((len = bis.read(bys)) != -1) {
                        bos.write(bys,0,len);
                }
               
                bis.close();
                bos.close();
        }

}

评分

参与人数 1黑马币 +20 收起 理由
xiaodong + 20

查看全部评分

0 个回复

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