|
|
@@ -89,15 +89,14 @@ public class FileSource implements ISource {
|
|
|
}
|
|
|
|
|
|
public static StringBuilder loadFile(File file, String encoding) {
|
|
|
- StringBuilder ret = new StringBuilder((int)file.length() + 3);
|
|
|
-
|
|
|
- char[] buf = new char[1024];
|
|
|
try (InputStreamReader isr = new InputStreamReader(new FileInputStream(file), encoding)) {
|
|
|
+ StringBuilder ret = new StringBuilder((int)file.length() + 3);
|
|
|
+ char[] buf = new char[1024];
|
|
|
for (int num; (num = isr.read(buf, 0, buf.length)) != -1;) {
|
|
|
ret.append(buf, 0, num);
|
|
|
}
|
|
|
-
|
|
|
return ret;
|
|
|
+
|
|
|
} catch (Exception e) {
|
|
|
throw new RuntimeException(e);
|
|
|
}
|