语言

AsynchronousFileChannel.Open 方法

定义

重载

名称 说明
Open(IPath, ICollection<IOpenOption>, IExecutorService, IFileAttribute[])

打开或创建一个用于读取和/或写入的文件,返回一个异步文件通道来访问该文件。

Open(IPath, IOpenOption[])

打开或创建一个用于读取和/或写入的文件,返回一个异步文件通道来访问该文件。

Open(IPath, ICollection<IOpenOption>, IExecutorService, IFileAttribute[])

打开或创建一个用于读取和/或写入的文件,返回一个异步文件通道来访问该文件。

[Android.Runtime.Register("open", "(Ljava/nio/file/Path;Ljava/util/Set;Ljava/util/concurrent/ExecutorService;[Ljava/nio/file/attribute/FileAttribute;)Ljava/nio/channels/AsynchronousFileChannel;", "", ApiSince=26)]
public static Java.Nio.Channels.AsynchronousFileChannel? Open(Java.Nio.FileNio.IPath? file, System.Collections.Generic.ICollection<Java.Nio.FileNio.IOpenOption>? options, Java.Util.Concurrent.IExecutorService? executor, params Java.Nio.FileNio.Attributes.IFileAttribute[]? attrs);
[<Android.Runtime.Register("open", "(Ljava/nio/file/Path;Ljava/util/Set;Ljava/util/concurrent/ExecutorService;[Ljava/nio/file/attribute/FileAttribute;)Ljava/nio/channels/AsynchronousFileChannel;", "", ApiSince=26)>]
static member Open : Java.Nio.FileNio.IPath * System.Collections.Generic.ICollection<Java.Nio.FileNio.IOpenOption> * Java.Util.Concurrent.IExecutorService * Java.Nio.FileNio.Attributes.IFileAttribute[] -> Java.Nio.Channels.AsynchronousFileChannel

参数

file
IPath

要打开或创建的文件的路径

options
ICollection<IOpenOption>

指定文件打开方式的选项

executor
IExecutorService

用于将通道与默认线程池关联的线程池或 null

attrs
IFileAttribute[]

创建文件时要以原子方式设置的文件属性的可选列表

返回

新的异步文件通道

特性

注解

Java文档java.nio.channels.AsynchronousFileChannel.open(java.nio.file.Path, java.nio.file.OpenOption)。

Java参考java.nio.channels.AsynchronousFileChannel.open。

本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。

适用于

Open(IPath, IOpenOption[])

打开或创建一个用于读取和/或写入的文件,返回一个异步文件通道来访问该文件。

[Android.Runtime.Register("open", "(Ljava/nio/file/Path;[Ljava/nio/file/OpenOption;)Ljava/nio/channels/AsynchronousFileChannel;", "", ApiSince=26)]
public static Java.Nio.Channels.AsynchronousFileChannel? Open(Java.Nio.FileNio.IPath? file, params Java.Nio.FileNio.IOpenOption[]? options);
[<Android.Runtime.Register("open", "(Ljava/nio/file/Path;[Ljava/nio/file/OpenOption;)Ljava/nio/channels/AsynchronousFileChannel;", "", ApiSince=26)>]
static member Open : Java.Nio.FileNio.IPath * Java.Nio.FileNio.IOpenOption[] -> Java.Nio.Channels.AsynchronousFileChannel

参数

file
IPath

要打开或创建的文件的路径

options
IOpenOption[]

指定文件打开方式的选项

返回

新的异步文件通道

特性

注解

Java文档java.nio.channels.AsynchronousFileChannel.open(java.nio.file.Path, java.nio.file.OpenOption)。

本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。

适用于