Ejemplo n.º 1
0
 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();
 }
Ejemplo n.º 2
0
 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();
 }