removed unnecessary string=>utf8 byte[]=>input stream=>reader converts, utf8 helper added (UnsupportedEndodingException should not thrown)

This commit is contained in:
Honfika
2013-11-17 09:08:05 +01:00
parent 9a7016fe29
commit f0697ebeb6
64 changed files with 319 additions and 215 deletions
@@ -30,6 +30,7 @@ import com.jpexs.helpers.Cache;
import com.jpexs.helpers.Helper;
import com.jpexs.helpers.ProgressListener;
import com.jpexs.helpers.ReReadableInputStream;
import com.jpexs.helpers.utf8.Utf8PrintWriter;
import com.sun.jna.Platform;
import java.awt.*;
import java.awt.event.ActionEvent;
@@ -608,11 +609,7 @@ public class Main {
} else {
if (f.getName().endsWith(".java")) {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
PrintWriter pw = null;
try {
pw = new PrintWriter(new OutputStreamWriter(baos, "utf8"));
} catch (UnsupportedEncodingException ex) {
}
PrintWriter pw = new Utf8PrintWriter(baos);
try {
try (BufferedReader br = new BufferedReader(new FileReader(f))) {
String s;