zoukankan      html  css  js  c++  java
  • 带进度条的输入流

            try{
                byte[]b=new byte[2];
                File file1=new File("test1.txt");
                FileInputStream in1=new FileInputStream(file1);
                ProgressMonitorInputStream progress1=new ProgressMonitorInputStream(null,"huang",in1);
                ProgressMonitor p=progress1.getProgressMonitor();//get进度条
                for(;(progress1.read(b))!=-1;){//注意是progress1来读取
    //            in1.read(b);
                    String s=new String(b);
                    System.out.print(s);
                    Thread.sleep(10);
                }
            }
            catch(Exception e){}
        
  • 相关阅读:
    hdoj:2075
    hdoj:2072
    hdoj:2071
    hdoj:2070
    hdoj:2069
    test001
    hdoj:2067
    hdoj:2061
    hdoj:2058
    hdoj:2057
  • 原文地址:https://www.cnblogs.com/vhyc/p/6040619.html
Copyright © 2011-2022 走看看