PipelineBuffer.GetBlobData(Int32, Int32, Int32) 方法

定义

从存储在 PipelineBuffer 列中的二进制大型对象 (BLOB) 中检索一个字节数组。

public:
 cli::array <System::Byte> ^ GetBlobData(int columnIndex, int offset, int count);
public byte[] GetBlobData (int columnIndex, int offset, int count);
member this.GetBlobData : int * int * int -> byte[]
Public Function GetBlobData (columnIndex As Integer, offset As Integer, count As Integer) As Byte()

参数

columnIndex
Int32

包含 BLOB 的列的索引。

offset
Int32

BLOB 中要从 BLOB 开始检索字节的点。

count
Int32

要从 BLOB 检索的字节数。

返回

Byte[]

PipelineBuffer 列中的字节数组。

示例

以下示例从 PipelineBuffer 列检索整个字节数组。

public override void ProcessInput(int inputID, PipelineBuffer buffer)  
{  
   IDTSInput100 input = ComponentMetaData.InputCollection.GetObjectByID(inputID);  

   foreach (IDTSInputColumn100 col in input.InputColumnCollection)  
   {  
      int index = BufferManager.FindColumnByLineageID(input.Buffer, col.LineageID);  
      BufferColumn bc = buffer.GetColumnInfo(index);  

      if (bc.DataType == DataType.DT_IMAGE)  
      {  
         uint blobLength =  buffer.GetBlobLength(index);  
         byte [] blobBytes = buffer.GetBlobData(index, 0, (int)blobLength);  

         //TODO: Do something with the blob data.  

      }  
   }  
}  
Public  Overrides Sub ProcessInput(ByVal inputID As Integer, ByVal buffer As PipelineBuffer)   
 Dim input As IDTSInput100 = ComponentMetaData.InputCollection.GetObjectByID(inputID)   
 For Each col As IDTSInputColumn100 In input.InputColumnCollection   
   Dim index As Integer = BufferManager.FindColumnByLineageID(input.Buffer, col.LineageID)   
   Dim bc As BufferColumn = buffer.GetColumnInfo(index)   
   If bc.DataType = DataType.DT_IMAGE Then   
     Dim blobLength As System.UInt32 = buffer.GetBlobLength(index)   
     Dim blobBytes As Byte() = buffer.GetBlobData(index, 0, CType(blobLength, Integer))   
     'TODO: Do something with the blob data  
   End If   
 Next   
End Sub  

注解

此方法适用于以下 Integration Services 数据类型:

PipelineBuffer 包含 BLOB 的列(如 a DT_IMAGE)检索数据时,可以使用参数指定 BLOB offset 中的起始位置以及要在参数中 count 检索的字节数。

有关 Integration Services 数据类型的完整列表以及用于每种类型的类的相应GetSet方法PipelineBuffer,请参阅数据流中的“处理数据类型”。

适用于