/** * @nowebref */ static public void saveStrings(OutputStream output, String[] data) { PrintWriter writer = createWriter(output); for (int i = 0; i < data.length; i++) { writer.println(data[i]); } writer.flush(); writer.close(); }
public boolean save(File file, String options) { PrintWriter writer = PApplet.createWriter(file); boolean result = write(writer); writer.flush(); writer.close(); return result; }
public boolean save(File file, String options) { PrintWriter writer = PApplet.createWriter(file); boolean success = write(writer, options); writer.close(); return success; }
public boolean save(File file, String options) { PrintWriter writer = PApplet.createWriter(file); boolean success = write(writer, options); writer.close(); return success; }
public boolean save(File file, String options) { PrintWriter writer = PApplet.createWriter(file); boolean result = write(writer); writer.flush(); writer.close(); return result; }
/** * I want to print lines to a file. Why can't I? */ public PrintWriter createWriter(String filename) { return createWriter(saveFile(filename)); }
protected boolean save(OutputStream output) { return save(PApplet.createWriter(output)); }
public boolean save(File file, String options) { return write(PApplet.createWriter(file)); }
public boolean save(File file, String options) { return save(PApplet.createWriter(file)); }
/** * I want to print lines to a file. I have RSI from typing these * eight lines of code so many times. */ static public PrintWriter createWriter(File file) { try { OutputStream output = new FileOutputStream(file); if (file.getName().toLowerCase().endsWith(".gz")) { output = new GZIPOutputStream(output); } return createWriter(output); } catch (Exception e) { if (file == null) { throw new RuntimeException("File passed to createWriter() was null"); } else { e.printStackTrace(); throw new RuntimeException("Couldn't create a writer for " + file.getAbsolutePath()); } } //return null; }
/** * @nowebref * I want to print lines to a file. I have RSI from typing these * eight lines of code so many times. */ static public PrintWriter createWriter(File file) { if (file == null) { throw new RuntimeException("File passed to createWriter() was null"); } try { createPath(file); // make sure in-between folders exist OutputStream output = new FileOutputStream(file); if (file.getName().toLowerCase().endsWith(".gz")) { output = new GZIPOutputStream(output); } return createWriter(output); } catch (Exception e) { throw new RuntimeException("Couldn't create a writer for " + file.getAbsolutePath(), e); } }
/** * ( begin auto-generated from createWriter.xml ) * * Creates a new file in the sketch folder, and a <b>PrintWriter</b> object * to write to it. For the file to be made correctly, it should be flushed * and must be closed with its <b>flush()</b> and <b>close()</b> methods * (see above example). * <br/> <br/> * Starting with Processing release 0134, all files loaded and saved by the * Processing API use UTF-8 encoding. In previous releases, the default * encoding for your platform was used, which causes problems when files * are moved to other platforms. * * ( end auto-generated ) * * @webref output:files * @param filename name of the file to be created * @see PrintWriter * @see PApplet#createReader * @see BufferedReader */ public PrintWriter createWriter(String filename) { return createWriter(saveFile(filename)); }
static public void convertARParamFromDevice(PApplet pa, ProjectiveDeviceP pdp, String outputDAT) throws Exception { PrintWriter pw = pa.createWriter(outputDAT); StringBuffer sb = new StringBuffer();
PrintWriter pw = pa.createWriter(outputDAT);
PrintWriter pw = pa.createWriter(outputDAT);
public boolean save(OutputStream output, String options) { PrintWriter writer = PApplet.createWriter(output); String extension = null; if (options == null) {
} else { hmb.write(output); hmb.writeln(PApplet.createWriter(new File(columnTitles[col] + ".categories")));
PrintWriter pw = pa.createWriter(outputDAT); StringBuffer sb = new StringBuffer();
public boolean save(OutputStream output, String options) { PrintWriter writer = PApplet.createWriter(output); String extension = null; if (options == null) {
writer = PApplet.createWriter(file);