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 データ型で動作します。

BLOB を含む列から PipelineBuffer データを取得する場合は、 DT_IMAGEパラメーターを使用 offset して BLOB の開始位置と、パラメーターで取得するバイト数を count 指定します。

Integration Services データ型の完全な一覧と、各型で使用するクラスのPipelineBuffer対応するGetSetメソッドについては、「Data Flowでのデータ型の操作」を参照してください。

適用対象