X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Futils%2FIOUtils.java;h=0004a4e7d79008d303a5c00abf238f1ec65352fc;hb=f8147a0ee57317e96d9ff0bf19573f7168d0354c;hp=9ab638af06e1486122de1c059abec3eb5b0a4980;hpb=028ff7c29a8fb07c702ffd34913a5dd22b688211;p=nikiroo-utils.git diff --git a/src/be/nikiroo/utils/IOUtils.java b/src/be/nikiroo/utils/IOUtils.java index 9ab638a..0004a4e 100644 --- a/src/be/nikiroo/utils/IOUtils.java +++ b/src/be/nikiroo/utils/IOUtils.java @@ -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(); }