XmlReader.ReadContentAsBinHexAsync(Byte[], Int32, Int32) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
非同步讀取內容並回傳 BinHex 解碼後的二進位位元組。
public:
virtual System::Threading::Tasks::Task<int> ^ ReadContentAsBinHexAsync(cli::array <System::Byte> ^ buffer, int index, int count);
public virtual System.Threading.Tasks.Task<int> ReadContentAsBinHexAsync(byte[] buffer, int index, int count);
abstract member ReadContentAsBinHexAsync : byte[] * int * int -> System.Threading.Tasks.Task<int>
override this.ReadContentAsBinHexAsync : byte[] * int * int -> System.Threading.Tasks.Task<int>
Public Overridable Function ReadContentAsBinHexAsync (buffer As Byte(), index As Integer, count As Integer) As Task(Of Integer)
參數
- buffer
- Byte[]
就是將產生的文字複製到的緩衝區。 這個值不能是 null。
- index
- Int32
移量移量進入緩衝區,開始複製結果。
- count
- Int32
複製到緩衝區的最大位元組數。 此方法會回傳實際複製的位元組數。
傳回
寫入緩衝區的位元組數。
例外狀況
在先前非同步操作結束前,會呼叫一個 XmlReader 方法。 此時, InvalidOperationException 會拋出「非同步操作已進行中」的訊息。
-或-
呼叫非 XmlReader 同步方法時未將 Async 標記設為 true。 此時, InvalidOperationException 會跳出「若你想使用非同步方法,將 XmlReaderSettings.Async 設為 true」的訊息。
備註
這是 的 ReadContentAsBinHex非同步版本,功能相同。 使用此方法時,必須將 標記設 Async 為 true。
此方法在任務中儲存所有非使用例外,該方法的同步對應程式可拋出這些例外。 如果回傳的任務中儲存了例外,該例外會在等待任務時拋出。 使用例外錯誤,例如 ArgumentException,仍會同步拋出。 關於儲存的例外,請參見由 ReadContentAsBinHex(Byte[], Int32, Int32)拋出的例外。