SqlChars.Read(Int64, Char[], Int32, Int32) SqlChars.Read(Int64, Char[], Int32, Int32) SqlChars.Read(Int64, Char[], Int32, Int32) SqlChars.Read(Int64, Char[], Int32, Int32) Method

定义

将此 SqlChars 实例中的字符复制到传入缓冲区中,并返回复制的字符数。Copies characters from this SqlChars instance to the passed-in buffer and returns the number of copied characters.

public:
 long Read(long offset, cli::array <char> ^ buffer, int offsetInBuffer, int count);
public long Read (long offset, char[] buffer, int offsetInBuffer, int count);
member this.Read : int64 * char[] * int * int -> int64
Public Function Read (offset As Long, buffer As Char(), offsetInBuffer As Integer, count As Integer) As Long

参数

offset
Int64 Int64 Int64 Int64

SqlChars 实例中所含值的 Int64long 值偏移量。An Int64long value offset into the value that is contained in the SqlChars instance.

buffer
Char[]

向其复制的字符数组缓冲区。The character array buffer to copy into.

offsetInBuffer
Int32 Int32 Int32 Int32

缓冲区中的一个 Int32 整数偏移量,以启动“复制到”操作。An Int32 integer offset into the buffer to start copying into.

count
Int32 Int32 Int32 Int32

一个 Int32 整数值,表示要复制的字符数。An Int32 integer value representing the number of characters to copy.

返回

表示已复制字节数的 Int64long 值。An Int64long value representing the number of copied bytes.

注解

如果尝试读取超出MaxLength,将引发异常。If an attempt is made to read beyond MaxLength, an exception is thrown.

如果count指定更多的字符不是可从要复制offsetInBuffer仅可用的字符复制到值的末尾。If count specifies more characters to be copied than are available from the offsetInBuffer to the end of the value, only the available characters are copied.

如果目标缓冲区为空引用,将引发异常。An exception is thrown if the destination buffer is a null reference.

如果目标缓冲区无法接收请求的所有字符,将引发异常。An exception is thrown if the destination buffer cannot receive as many characters as requested.

适用于

另请参阅