語言

FileSystemProvider.NewAsynchronousFileChannel 方法

定義

開啟或建立一個用於讀取和/或寫入的檔案,並回傳一個非同步的檔案通道以存取該檔案。

[Android.Runtime.Register("newAsynchronousFileChannel", "(Ljava/nio/file/Path;Ljava/util/Set;Ljava/util/concurrent/ExecutorService;[Ljava/nio/file/attribute/FileAttribute;)Ljava/nio/channels/AsynchronousFileChannel;", "GetNewAsynchronousFileChannel_Ljava_nio_file_Path_Ljava_util_Set_Ljava_util_concurrent_ExecutorService_arrayLjava_nio_file_attribute_FileAttribute_Handler", ApiSince=26)]
public virtual Java.Nio.Channels.AsynchronousFileChannel? NewAsynchronousFileChannel(Java.Nio.FileNio.IPath? path, System.Collections.Generic.ICollection<Java.Nio.FileNio.IOpenOption>? options, Java.Util.Concurrent.IExecutorService? executor, params Java.Nio.FileNio.Attributes.IFileAttribute[]? attrs);
[<Android.Runtime.Register("newAsynchronousFileChannel", "(Ljava/nio/file/Path;Ljava/util/Set;Ljava/util/concurrent/ExecutorService;[Ljava/nio/file/attribute/FileAttribute;)Ljava/nio/channels/AsynchronousFileChannel;", "GetNewAsynchronousFileChannel_Ljava_nio_file_Path_Ljava_util_Set_Ljava_util_concurrent_ExecutorService_arrayLjava_nio_file_attribute_FileAttribute_Handler", ApiSince=26)>]
abstract member NewAsynchronousFileChannel : 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
override this.NewAsynchronousFileChannel : 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

參數

path
IPath

檔案開啟或建立的路徑

options
ICollection<IOpenOption>

指定檔案開啟方式的選項

executor
IExecutorService

執行緒池,或 null 將通道與預設執行緒池關聯起來

attrs
IFileAttribute[]

一個可選的檔案屬性清單,可在建立檔案時原子式地設定

傳回

一個新的非同步檔案通道

屬性

備註

Java 文件 java.nio.file.spi.FileSystemProvider.newAsynchronousFileChannel(java.nio.file.Path, java.util.Set, java.util.concurrent.ExecutorService, java.nio.file.attribute.FileAttribute)。

本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。

適用於