[Title] common-eplugin: fixed to avoid closing when an exception is occurred
authorJihoon Song <jihoon80.song@samsung.com>
Tue, 14 May 2013 05:41:48 +0000 (14:41 +0900)
committerJihoon Song <jihoon80.song@samsung.com>
Tue, 14 May 2013 05:41:48 +0000 (14:41 +0900)
[Desc.]
[Issue]

Change-Id: I99805fdcc4f82d04794f18ee98579632137d83b7

org.tizen.common/src/org/tizen/common/util/FileUtil.java

index da3a212..15d4a03 100755 (executable)
@@ -381,12 +381,14 @@ public class FileUtil {
             throw new IOException("Unable to write file " + fromFile + " on itself.");
         }
 
-        BufferedInputStream in = null;
-        BufferedOutputStream out = null;
+        InputStream in = null;
+        OutputStream out = null;
 
         try {
-            in = new BufferedInputStream(new FileInputStream(fromFile), BUFFER_SIZE);
-            out = new BufferedOutputStream(new FileOutputStream(toFile, append), BUFFER_SIZE);
+            in = new FileInputStream( fromFile );
+            in = new BufferedInputStream( in, BUFFER_SIZE );
+            out = new FileOutputStream( toFile, append );
+            out = new BufferedOutputStream( out, BUFFER_SIZE );
 
             IOUtil.redirect( in, out );
         } finally {