示例#1
0
文件: Test.java 项目: hydrodog/LiquiZ
 public static void writeJS(String filename, Displayable d) throws IOException {
   FileWriter fw = new FileWriter(filename);
   StringBuilder b = new StringBuilder(65536);
   d.writeJS(b);
   fw.write(b.toString());
   fw.close();
 }
示例#2
0
文件: Test.java 项目: hydrodog/LiquiZ
 private static String load(String filename) throws IOException {
   FileReader fr = new FileReader(filename);
   int len = 16384;
   StringBuilder b = new StringBuilder(len);
   int charsRead;
   while ((charsRead = fr.read(buf)) > 0) {
     b.append(buf, 0, charsRead - 1);
   }
   return b.toString();
 }