Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 11.0.1 (中文) » UltraLite - .NET 编程 » UltraLite .NET 2.0 API 参考 » ULDataReader 类 » GetBytes 方法

 

GetBytes(Int32, Int64, Byte[], Int32, Int32) 方法

从指定的偏移量开始,到目标 System.Byte 数组的指定偏移量为止,复制指定的 ULDbType.LongBinary 列的值的子集。

语法
Visual Basic
Public Overrides Function GetBytes( _
   ByVal columnID As Integer, _
   ByVal srcOffset As Long, _
   ByVal dst As Byte(), _
   ByVal dstOffset As Integer, _
   ByVal count As Integer _
) As Long
C#
public override long GetBytes(
   int columnID,
   long srcOffset,
   byte[] dst,
   int dstOffset,
   int count
);
参数
  • columnID   列的 ID 号。值必须在 [0,ULDataReader.FieldCount-1] 范围内。游标中第一列的 ID 值为 0。

  • srcOffset   列值的起始位置。该值从零开始。

  • dst   目标数组。

  • dstOffset   目标数组的起始位置。

  • count   要复制的字节数。

返回值

实际复制的字节数。

注释

如果传递一个为空值引用(在 Visual Basic 中是 Nothing)的 dst 缓冲区,GetBytes 会以字节为单位返回该字段的长度。

位于值的 srcOffsetsrcOffset+count-1 之间的字节将被逐个复制到目标数组的 dstOffsetdstOffset+count-1 位置处。如果在复制完 count 个字节之前就到达了值尾,则目标数组的剩余部分保持不变。

如果出现以下任一情况,则抛出代码为 ULSQLCode.SQLE_INVALID_PARAMETER 的 ULException,并且不会修改目标:

对于其它错误,抛出具有相应错误代码的 ULException。

另请参见