/** * Identical to the other saveStream(), but writes to a File * object, for greater control over the file location. * Note that unlike other api methods, this will not automatically * compress or uncompress gzip files. */ public boolean saveStream(File targetFile, String sourceLocation) { return saveStream(targetFile, createInputRaw(sourceLocation)); }
/** * Identical to the other saveStream(), but writes to a File * object, for greater control over the file location. * <p/> * Note that unlike other api methods, this will not automatically * compress or uncompress gzip files. */ public boolean saveStream(File target, String source) { return saveStream(target, createInputRaw(source)); }
/** * @nowebref */ public boolean saveStream(String target, InputStream source) { return saveStream(saveFile(target), source); }
/** * Save the contents of a stream to a file in the sketch folder. * This is basically saveBytes(blah, loadBytes()), but done * more efficiently (and with less confusing syntax). */ public boolean saveStream(String targetFilename, String sourceLocation) { return saveStream(saveFile(targetFilename), sourceLocation); }
public boolean saveStream(String targetFilename, InputStream sourceStream) { return saveStream(saveFile(targetFilename), sourceStream); }
/** * ( begin auto-generated from saveStream.xml ) * * Save the contents of a stream to a file in the sketch folder. This is * basically <b>saveBytes(blah, loadBytes())</b>, but done more efficiently * (and with less confusing syntax).<br /> * <br /> * When using the <b>targetFile</b> parameter, it writes to a <b>File</b> * object for greater control over the file location. (Note that unlike * some other functions, this will not automatically compress or uncompress * gzip files.) * * ( end auto-generated ) * * @webref output:files * @param target name of the file to write to * @param source location to read from (a filename, path, or URL) * @see PApplet#createOutput(String) */ public boolean saveStream(String target, String source) { return saveStream(saveFile(target), source); }
FileOutputStream targetStream = new FileOutputStream(tempFile); saveStream(targetStream, source); targetStream.close(); targetStream = null;