FileStream.BeginWrite(Byte[], Int32, Int32, AsyncCallback, Object) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
开始异步写入操作。 请考虑改用 WriteAsync(Byte[], Int32, Int32, CancellationToken)。
public:
override IAsyncResult ^ BeginWrite(cli::array <System::Byte> ^ array, int offset, int numBytes, AsyncCallback ^ userCallback, System::Object ^ stateObject);
public:
override IAsyncResult ^ BeginWrite(cli::array <System::Byte> ^ array, int offset, int numBytes, AsyncCallback ^ callback, System::Object ^ state);
public override IAsyncResult BeginWrite(byte[] array, int offset, int numBytes, AsyncCallback userCallback, object stateObject);
public override IAsyncResult BeginWrite(byte[] array, int offset, int numBytes, AsyncCallback callback, object state);
override this.BeginWrite : byte[] * int * int * AsyncCallback * obj -> IAsyncResult
override this.BeginWrite : byte[] * int * int * AsyncCallback * obj -> IAsyncResult
Public Overrides Function BeginWrite (array As Byte(), offset As Integer, numBytes As Integer, userCallback As AsyncCallback, stateObject As Object) As IAsyncResult
Public Overrides Function BeginWrite (array As Byte(), offset As Integer, numBytes As Integer, callback As AsyncCallback, state As Object) As IAsyncResult
参数
- arraybuffer
- Byte[]
包含要写入到当前流的数据的缓冲区。
- offset
- Int32
从零开始的字节偏移量 array ,开始将字节复制到当前流。
- numBytescount
- Int32
要写入的最大字节数。
- callbackuserCallback
- AsyncCallback
异步写入操作完成时要调用的方法。
- statestateObject
- Object
用户提供的对象,用于区分此特定异步写入请求与其他请求。
返回
引用异步写入的对象。
例外
array 长度减号 offset 小于 numBytes。
array 是 null。
offset 或 numBytes 为负数。
流不支持写入。
流已关闭。
出现 I/O 错误。