PipelineBuffer.GetBlobData(Int32, Int32, Int32) Metode
Definisi
Penting
Beberapa informasi terkait produk prarilis yang dapat diubah secara signifikan sebelum dirilis. Microsoft tidak memberikan jaminan, tersirat maupun tersurat, sehubungan dengan informasi yang diberikan di sini.
Mengambil array byte dari objek besar biner (BLOB) yang PipelineBuffer disimpan dalam kolom.
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()
Parameter
- columnIndex
- Int32
Indeks kolom yang berisi BLOB.
- offset
- Int32
Titik dalam BLOB untuk mulai mengambil byte dari BLOB.
- count
- Int32
Jumlah byte yang akan diambil dari BLOB.
Mengembalikan
Array byte dalam PipelineBuffer kolom.
Contoh
Contoh berikut mengambil seluruh array byte dari PipelineBuffer kolom.
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
Keterangan
Metode ini berfungsi dengan jenis data Integration Services berikut:
Saat mengambil data dari PipelineBuffer kolom yang berisi BLOB, seperti DT_IMAGE, Anda menentukan lokasi awal di BLOB dengan offset parameter dan jumlah byte yang akan diambil dalam count parameter .
Untuk daftar lengkap jenis data Integration Services dan metode dan Set terkait Get dari PipelineBuffer kelas yang akan digunakan dengan setiap jenis, lihat Bekerja dengan Jenis Data di Aliran Data.