首页 > 文档 > createOutput()创建输出
2017
08-02

createOutput()创建输出

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

filename

String: name of the file to open

要打开的文件名

Returns

OutputStream

Related

createInput()
selectOutput()



最后编辑:
作者:卡萨布兰卡
这个作者貌似有点懒,什么都没有留下。

留下一个回复

你的email不会被公开。