Sdílet prostřednictvím


FileSystemProvider.NewFileChannel Method

Definition

Opens or creates a file for reading and/or writing, returning a file channel to access the file.

[Android.Runtime.Register("newFileChannel", "(Ljava/nio/file/Path;Ljava/util/Set;[Ljava/nio/file/attribute/FileAttribute;)Ljava/nio/channels/FileChannel;", "GetNewFileChannel_Ljava_nio_file_Path_Ljava_util_Set_arrayLjava_nio_file_attribute_FileAttribute_Handler", ApiSince=26)]
public virtual Java.Nio.Channels.FileChannel? NewFileChannel (Java.Nio.FileNio.IPath? path, System.Collections.Generic.ICollection<Java.Nio.FileNio.IOpenOption>? options, params Java.Nio.FileNio.Attributes.IFileAttribute[]? attrs);
[<Android.Runtime.Register("newFileChannel", "(Ljava/nio/file/Path;Ljava/util/Set;[Ljava/nio/file/attribute/FileAttribute;)Ljava/nio/channels/FileChannel;", "GetNewFileChannel_Ljava_nio_file_Path_Ljava_util_Set_arrayLjava_nio_file_attribute_FileAttribute_Handler", ApiSince=26)>]
abstract member NewFileChannel : Java.Nio.FileNio.IPath * System.Collections.Generic.ICollection<Java.Nio.FileNio.IOpenOption> * Java.Nio.FileNio.Attributes.IFileAttribute[] -> Java.Nio.Channels.FileChannel
override this.NewFileChannel : Java.Nio.FileNio.IPath * System.Collections.Generic.ICollection<Java.Nio.FileNio.IOpenOption> * Java.Nio.FileNio.Attributes.IFileAttribute[] -> Java.Nio.Channels.FileChannel

Parameters

path
IPath

the path of the file to open or create

options
ICollection<IOpenOption>

options specifying how the file is opened

attrs
IFileAttribute[]

an optional list of file attributes to set atomically when creating the file

Returns

a new file channel

Attributes

Remarks

Java documentation for java.nio.file.spi.FileSystemProvider.newFileChannel(java.nio.file.Path, java.util.Set, java.nio.file.attribute.FileAttribute).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to