createOutput()

本参考资料用于Processing 3.0+。 如果你使用的是前一版本,请在使用软件帮助菜单内的参考资料。. If you see any errors or have suggestions, please let us know. If you prefer a more technical reference, visit the Processing Core Javadoc and Libraries Javadoc.

名称

createOutput()

示例
描述 Similar to createInput(), this creates a Java OutputStream for a given filename or path. The file will be created in the sketch folder, or in the same folder as an exported application.

If the path does not exist, intermediate folders will be created. If an exception occurs, it will be printed to the console, and null will be returned.

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.

If the output filename ends with .gz, the output will be automatically GZIP compressed as it is written.

语法
createOutput(filename)
参数
filename String: name of the file to open
返回值 OutputStream
相关 createInput()
selectOutput()

Updated on October 2, 2018 05:02:07pm EDT

createOutput()