Revision: 3070
          http://vexi.svn.sourceforge.net/vexi/?rev=3070&view=rev
Author:   mkpg2
Date:     2008-08-11 19:08:57 +0000 (Mon, 11 Aug 2008)

Log Message:
-----------
Test for piping.

Modified Paths:
--------------
    trunk/core/org.ibex.util/src/org/ibex/util/IOUtil.java

Modified: trunk/core/org.ibex.util/src/org/ibex/util/IOUtil.java
===================================================================
--- trunk/core/org.ibex.util/src/org/ibex/util/IOUtil.java      2008-08-11 
18:30:43 UTC (rev 3069)
+++ trunk/core/org.ibex.util/src/org/ibex/util/IOUtil.java      2008-08-11 
19:08:57 UTC (rev 3070)
@@ -33,10 +33,15 @@
     }
 
     public static synchronized void pipe(InputStream in, OutputStream out) 
throws IOException {
-       while (true) {
-               int bytesRead = in.read(workspace);
-               if (bytesRead == -1) break;
-               out.write(workspace, 0, bytesRead);
+       try{
+               while (true) {
+                       int bytesRead = in.read(workspace);
+                       if (bytesRead == -1) break;
+                       out.write(workspace, 0, bytesRead);
+
+               }
+       }finally{
+               out.close();
        }
     }    
 }


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Vexi-svn mailing list
Vexi-svn@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/vexi-svn

Reply via email to