IO_实训.docVIP

  • 11
  • 0
  • 约 18页
  • 2016-11-28 发布于河南
  • 举报
IO_实训

代码1.切割器 public class Files_Splitor { private static int size=1024*1024; //文件切割器 public static void main(String[] args) throws IOException { File file=new File(D:\\r.flv); splitor(file);} public static void splitor(File file) throws IOException{ //建立一个Properties对象,用于存储信息 Properties prop =new Properties(); //用读取流关联文件 FileInputStream fis =new FileInputStream(file); //自定义缓冲区,根据需要确定其大小 byte buf[]=new byte[size]; int len=0; FileOutputStream fos=null; int count=1; //创建一个存储路径,用于存储切割后的文件 File dir=new File(D:\\part_file);//其中的 dir代表父路径 if(!dir.exists()){ dir.mkdirs()

文档评论(0)

1亿VIP精品文档

相关文档