Author: nextgens
Date: 2008-05-28 13:11:03 +0000 (Wed, 28 May 2008)
New Revision: 20110

Modified:
   trunk/apps/new_installer/src/Sha1Test.java
Log:
new_installer: fix one of the infamous Buffered*Stream catches IOExceptions

Modified: trunk/apps/new_installer/src/Sha1Test.java
===================================================================
--- trunk/apps/new_installer/src/Sha1Test.java  2008-05-28 08:33:29 UTC (rev 
20109)
+++ trunk/apps/new_installer/src/Sha1Test.java  2008-05-28 13:11:03 UTC (rev 
20110)
@@ -108,10 +108,11 @@
                        dis = new DataInputStream(new BufferedInputStream(is));
                        File f = new File(filename);
                        os = new BufferedOutputStream(new FileOutputStream(f));
-                       int b;
+                       int b = 0;
                        while ((b = dis.read()) != -1) {
                                os.write(b);
                        }
+                       os.flush();
                } catch (MalformedURLException mue) {
                        System.out.println("Ouch - a MalformedURLException 
happened ; please report it.");
                        mue.printStackTrace();
@@ -124,6 +125,8 @@
                } finally {
                        try {
                                if(is != null) is.close();
+                       } catch (IOException ioe) {}
+                       try {
                                if(os != null) os.close();
                        } catch (IOException ioe) {}
                }


Reply via email to