/** * @nowebref */ static public void saveStrings(File file, String data[]) { saveStrings(createOutput(file), data); }
/** * ( begin auto-generated from createOutput.xml ) * * Similar to <b>createInput()</b>, this creates a Java <b>OutputStream</b> * for a given filename or path. The file will be created in the sketch * folder, or in the same folder as an exported application. * <br /><br /> * If the path does not exist, intermediate folders will be created. If an * exception occurs, it will be printed to the console, and <b>null</b> * will be returned. * <br /><br /> * This function is a convenience over the Java approach that requires you * to 1) create a FileOutputStream object, 2) determine the exact file * location, and 3) handle exceptions. Exceptions are handled internally by * the function, which is more appropriate for "sketch" projects. * <br /><br /> * If the output filename ends with <b>.gz</b>, the output will be * automatically GZIP compressed as it is written. * * ( end auto-generated ) * @webref output:files * @param filename name of the file to open * @see PApplet#createInput(String) * @see PApplet#selectOutput(String,String) */ public OutputStream createOutput(String filename) { return createOutput(saveFile(filename)); }
public boolean save(File file, String options) throws IOException { return save(PApplet.createOutput(file), Table.extensionOptions(false, file.getName(), options)); }
public boolean save(File file, String options) throws IOException { return save(PApplet.createOutput(file), Table.extensionOptions(false, file.getName(), options)); }
/** * @nowebref * Saves bytes to a specific File location specified by the user. */ static public void saveBytes(File file, byte[] data) { File tempFile = null; try { tempFile = createTempFile(file); OutputStream output = createOutput(tempFile); saveBytes(output, data); output.close(); output = null; if (file.exists()) { if (!file.delete()) { System.err.println("Could not replace " + file.getAbsolutePath()); } } if (!tempFile.renameTo(file)) { System.err.println("Could not rename temporary file " + tempFile.getAbsolutePath()); } } catch (IOException e) { System.err.println("error saving bytes to " + file); if (tempFile != null) { tempFile.delete(); } e.printStackTrace(); } }
new BufferedOutputStream(parent.createOutput(path), 16 * 1024);
double[] distort = cam.distortionCoeffs.get(); OutputStream os = pa.createOutput(outputDAT);
new BufferedOutputStream(PApplet.createOutput(file)); writer.setOutput(ImageIO.createImageOutputStream(output));
OutputStream os = pa.createOutput(outputDAT); PrintWriter pw = pa.createWriter(outputDAT); StringBuffer sb = new StringBuffer();