Язык

PipelineBuffer.GetBlobData(Int32, Int32, Int32) Метод

Определение

Получает массив байтов из бинарного большого объекта (BLOB), хранящегося в PipelineBuffer столбце.

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, например, DT_IMAGE, вы указываете исходное место в BLOB с offset параметром и числом байт, которые нужно получить в этом count параметре.

Полный список типов данных Integration Services и соответствующих Get методов SetPipelineBuffer класса для каждого типа см. раздел «Работа с типами данных в разделе Поток данных».

Применяется к