当前位置: 代码迷 >> Java相关 >> 对于输入输出流这块很迷茫,劳驾有谁可以帮帮我,谢谢
  详细解决方案

对于输入输出流这块很迷茫,劳驾有谁可以帮帮我,谢谢

热度:88   发布时间:2007-12-31 00:09:19.0
对于输入输出流这块很迷茫,劳驾有谁可以帮帮我,谢谢
刚学习java,我只想明白一些简单的有关输入输出流的程序语句就行,有没有简单易懂的资料可以看看
这是老师写的一段代码,帮我解释一下
try { InputStream in = new FileInputStream("c:\\z.jpg"); // 装配--有缓冲
          BufferedInputStream bin=new BufferedInputStream(in); // byte[]
          buf=new byte[bin.available];// 100kb 100*1000 bin.read(buf);
          byte[] buf=new byte[8192]; int n=0; OutputStream out=new
          FileOutputStream("e:\\d.mp3"); while((n=bin.read(buf,0,n))!=-1){
          out.write(buf,0,n); }
        

         配合输出 //OutputStream out=new FileOutputStream("e:\\d.mp3");
         out.write(buf); } catch (FileNotFoundException e) { // TODO 自动生成
                catch 块 e.printStackTrace(); } catch (IOException e) { // TODO 自动生成
         catch 块 e.printStackTrace(); }
搜索更多相关的解决方案: 劳驾  输出  输入  

----------------解决方案--------------------------------------------------------
  相关解决方案