Name |
createOutput()创建输出 |
||
Examples |
|||
Description |
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. 类似于 createInput (), 这将为给定的文件名或路径创建一个 java OutputStream。该文件将在 “草绘” 文件夹或与导出的应用程序位于同一文件夹中创建。
如果路径不存在, 将创建中间文件夹。如果发生异常, 将将其打印到控制台, 并返回 null。
此函数是一种方便的 java 方法, 需要您到 1) 创建一个 FileOutputStream 对象, 2) 确定确切的文件位置, 和 3) 处理异常。异常由函数在内部处理, 这更适合于 “草绘” 项目。
如果输出文件名以. gz 结尾, 则输出将在写入时自动按 gzip 压缩。 |
||
Syntax |
createOutput(filename) |
||
Parameters |
要打开的文件名 |
||
Returns |
OutputStream |
||
Related |
createInput() |
- 本文固定链接: http://iprocessing.cn/2017/08/02/createoutput创建输出/
- 转载请注明: 卡萨布兰卡 于 Processing编程艺术 发表