語言

AsynchronousFileChannel.Write 方法

定義

多載

名稱 Description
Write(ByteBuffer, Int64)

從指定緩衝區寫入一串位元組到該通道,從指定檔案位置開始。

Write(ByteBuffer, Int64, Object, ICompletionHandler)

從指定緩衝區寫入一串位元組到該通道,從指定檔案位置開始。

Write(ByteBuffer, Int64)

從指定緩衝區寫入一串位元組到該通道,從指定檔案位置開始。

[Android.Runtime.Register("write", "(Ljava/nio/ByteBuffer;J)Ljava/util/concurrent/Future;", "GetWrite_Ljava_nio_ByteBuffer_JHandler", ApiSince=26)]
public abstract Java.Util.Concurrent.IFuture? Write(Java.Nio.ByteBuffer? src, long position);
[<Android.Runtime.Register("write", "(Ljava/nio/ByteBuffer;J)Ljava/util/concurrent/Future;", "GetWrite_Ljava_nio_ByteBuffer_JHandler", ApiSince=26)>]
abstract member Write : Java.Nio.ByteBuffer * int64 -> Java.Util.Concurrent.IFuture

參數

src
ByteBuffer

位元組要從中傳送的緩衝區

position
Int64

傳輸開始的檔案位置;必須是非負數

傳回

一個 Future 代表待處理結果的物件

屬性

備註

從指定緩衝區寫入一串位元組到該通道,從指定檔案位置開始。

此方法從給定的緩衝區開始寫入一串位元組到該通道,從指定檔案位置開始。 該方法回傳 a Future 代表寫入操作的待處理結果。 Futures Future#get() get 方法回傳寫入的位元組數。

此方法的運作方式與原方法 AsynchronousByteChannel#write(ByteBuffer) 相同,不同之處是從指定檔案位置開始寫入位元組。 如果在嘗試寫入時,給定位置大小大於檔案大小,檔案會被成長以容納新的位元組;介於前一個檔案結束點與新寫入位元組之間的位元組值則未指定。

Java 文件 java.nio.channels.AsynchronousFileChannel.write(java.nio.ByteBuffer, long)。

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

適用於

Write(ByteBuffer, Int64, Object, ICompletionHandler)

從指定緩衝區寫入一串位元組到該通道,從指定檔案位置開始。

[Android.Runtime.Register("write", "(Ljava/nio/ByteBuffer;JLjava/lang/Object;Ljava/nio/channels/CompletionHandler;)V", "GetWrite_Ljava_nio_ByteBuffer_JLjava_lang_Object_Ljava_nio_channels_CompletionHandler_Handler", ApiSince=26)]
[Java.Interop.JavaTypeParameters(new System.String[] { "A" })]
public abstract void Write(Java.Nio.ByteBuffer? src, long position, Java.Lang.Object? attachment, Java.Nio.Channels.ICompletionHandler? handler);
[<Android.Runtime.Register("write", "(Ljava/nio/ByteBuffer;JLjava/lang/Object;Ljava/nio/channels/CompletionHandler;)V", "GetWrite_Ljava_nio_ByteBuffer_JLjava_lang_Object_Ljava_nio_channels_CompletionHandler_Handler", ApiSince=26)>]
[<Java.Interop.JavaTypeParameters(new System.String[] { "A" })>]
abstract member Write : Java.Nio.ByteBuffer * int64 * Java.Lang.Object * Java.Nio.Channels.ICompletionHandler -> unit

參數

src
ByteBuffer

位元組要從中傳送的緩衝區

position
Int64

傳輸開始的檔案位置;必須是非負數

attachment
Object

要附加到 I/O 操作上的物件;可以是 null

handler
ICompletionHandler

處理者會處理結果

屬性

備註

從指定緩衝區寫入一串位元組到該通道,從指定檔案位置開始。

此方法的運作方式與原方法 AsynchronousByteChannel#write(ByteBuffer,Object,CompletionHandler) 相同,不同之處是從指定檔案位置開始寫入位元組。 如果在嘗試寫入時,給定位置大小大於檔案大小,檔案會被成長以容納新的位元組;介於前一個檔案結束點與新寫入位元組之間的位元組值則未指定。

Java 文件 java.nio.channels.AsynchronousFileChannel.write(java.nio.ByteBuffer, long, A, java.nio.channels.CompletionHandler<java.lang.Integer, ? super A>)。

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

適用於