All getBytes("UTF-8") -> StringUtils
[nikiroo-utils.git] / src / be / nikiroo / utils / IOUtils.java
index 9ab638af06e1486122de1c059abec3eb5b0a4980..0004a4e7d79008d303a5c00abf238f1ec65352fc 100644 (file)
@@ -232,7 +232,7 @@ public class IOUtils {
                        throws IOException {
                FileOutputStream out = new FileOutputStream(file);
                try {
-                       out.write(content.getBytes("UTF-8"));
+                       out.write(StringUtils.getBytes(content));
                } finally {
                        out.close();
                }
@@ -410,19 +410,11 @@ public class IOUtils {
                        write(in, tmp);
                        in.close();
 
-                       final FileInputStream fis = new FileInputStream(tmp);
-                       return new MarkableFileInputStream(fis) {
+                       return new MarkableFileInputStream(tmp) {
                                @Override
                                public void close() throws IOException {
                                        try {
-                                               try {
-                                                       super.close();
-                                               } finally {
-                                                       try {
-                                                               fis.close();
-                                                       } catch (IOException e) {
-                                                       }
-                                               }
+                                               super.close();
                                        } finally {
                                                tmp.delete();
                                        }