XmlReader.ReadContentAsBinHexAsync(Byte[], Int32, Int32) XmlReader.ReadContentAsBinHexAsync(Byte[], Int32, Int32) XmlReader.ReadContentAsBinHexAsync(Byte[], Int32, Int32) XmlReader.ReadContentAsBinHexAsync(Byte[], Int32, Int32) Method

定义

异步读取内容并返回 BinHex 解码的二进制字节。Asynchronously reads the content and returns the BinHex decoded binary bytes.

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[]

结果文本复制到的缓冲区。The buffer into which to copy the resulting text. 此值不能为 nullThis value cannot be null.

index
Int32 Int32 Int32 Int32

缓冲区中的偏移,从这个位置开始将结果复制到缓冲区中。The offset into the buffer where to start copying the result.

count
Int32 Int32 Int32 Int32

要复制到缓冲区的最大字节数。The maximum number of bytes to copy into the buffer. 此方法返回复制的实际字节数。The actual number of bytes copied is returned from this method.

返回

写入缓冲区的字节数。The number of bytes written to the buffer.

异常

在上一次异步操作完成之前调用了 XmlReader 方法。An XmlReader method was called before a previous asynchronous operation finished. 在此情况下,会引发 InvalidOperationException 并显示消息“异步操作已在进行中。”In this case, InvalidOperationException is thrown with the message "An asynchronous operation is already in progress."

- 或 --or-

调用了 XmlReader 异步方法,但未将 Async 标志设置为 trueAn XmlReader asynchronous method was called without setting the Async flag to true. 在此情况下,将引发 InvalidOperationException 并显示消息“若要使用 Async 方法,请将 XmlReaderSettings.Async 设置为 True。”In this case, InvalidOperationException is thrown with the message "Set XmlReaderSettings.Async to true if you want to use Async Methods."

注解

这是的异步版本ReadContentAsBinHex,具有相同的功能。This is the asynchronous version of ReadContentAsBinHex, with the same functionality. 若要使用此方法,必须将Async标志设置为。 trueTo use this method, you must set the Async flag to true.

适用于

另请参阅