Aracılığıyla paylaş


PipelineBuffer.GetBlobData Yöntemi

Depolanan bir ikili büyük nesne (blob) bir bayt dizisi alır bir PipelineBuffer sütun.

Ad Alanı:  Microsoft.SqlServer.Dts.Pipeline
Derleme:  Microsoft.SqlServer.PipelineHost (Microsoft.SqlServer.PipelineHost içinde.dll)

Sözdizimi

'Bildirim
Public Function GetBlobData ( _
    columnIndex As Integer, _
    offset As Integer, _
    count As Integer _
) As Byte()
'Kullanım
Dim instance As PipelineBuffer
Dim columnIndex As Integer
Dim offset As Integer
Dim count As Integer
Dim returnValue As Byte()

returnValue = instance.GetBlobData(columnIndex, _
    offset, count)
public byte[] GetBlobData(
    int columnIndex,
    int offset,
    int count
)
public:
array<unsigned char>^ GetBlobData(
    int columnIndex, 
    int offset, 
    int count
)
member GetBlobData : 
        columnIndex:int * 
        offset:int * 
        count:int -> byte[] 
public function GetBlobData(
    columnIndex : int, 
    offset : int, 
    count : int
) : byte[]

Parametreler

  • columnIndex
    Tür: System.Int32
    blob içeren sütun dizini.
  • offset
    Tür: System.Int32
    DAMLA DAMLA bayt alma başlamak için nokta.
  • count
    Tür: System.Int32
    BİRİMDEN almak için bayt sayısı.

Dönüş Değeri

Tür: array<System.Byte[]
Bayt dizisi PipelineBuffer sütun.

Açıklamalar

Bu yöntem ile aşağıdaki çalışır Integration Services veri türleri:

Verileri alırken PipelineBuffer gibi bir blob içeren sütunlar bir DT_IMAGE, DAMLA ile başlangıç konumu belirtmek offset parametre ve de almak için bayt sayısı count parametresi.

Eksiksiz bir listesini görmek için Integration Services veri türleri ve karşılık gelen Al ve Set yöntemleri PipelineBuffer sınıfına her türü ile kullanmak için bkz: Veri akışı veri türleriyle çalışma.

Örnekler

Aşağıdaki örnek, tüm baytlar dizisi alır bir PipelineBuffer sütun.

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