PipelineBuffer.GetBlobData Method
Retrieves an array of bytes from a binary large object (BLOB) stored in a PipelineBuffer column.
네임스페이스: Microsoft.SqlServer.Dts.Pipeline
어셈블리: Microsoft.SqlServer.PipelineHost (in microsoft.sqlserver.pipelinehost.dll)
구문
‘선언
Public Function GetBlobData ( _
columnIndex As Integer, _
offset As Integer, _
count As Integer _
) As Byte()
public byte[] GetBlobData (
int columnIndex,
int offset,
int count
)
public:
array<unsigned char>^ GetBlobData (
int columnIndex,
int offset,
int count
)
public byte[] GetBlobData (
int columnIndex,
int offset,
int count
)
public function GetBlobData (
columnIndex : int,
offset : int,
count : int
) : byte[]
매개 변수
- columnIndex
The index of the column containing the BLOB.
- offset
The point in the binary large to begin retrieving bytes from the BLOB.
- count
The number of bytes to retrieve from the BLOB.
반환 값
The array of bytes in the PipelineBuffer column.
주의
When retrieving data from PipelineBuffer columns containing a BLOB, such as a DT_IMAGE, you specify the starting location in the BLOB with the offset parameter and the number of bytes to retrieve in the count parameter.
예
The following example retrieves the entire array of bytes from a PipelineBuffer column.
public override void ProcessInput(int inputID, PipelineBuffer buffer)
{
IDTSInput90 input = ComponentMetaData.InputCollection.GetObjectByID(inputID);
foreach (IDTSInputColumn90 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 IDTSInput90 = ComponentMetaData.InputCollection.GetObjectByID(inputID)
For Each col As IDTSInputColumn90 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
스레드 보안
Any public static (Shared in Microsoft Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
플랫폼
개발 플랫폼
지원되는 플랫폼 목록은 SQL Server 2005 설치를 위한 하드웨어 및 소프트웨어 요구 사항을 참조하십시오.
대상 플랫폼
지원되는 플랫폼 목록은 SQL Server 2005 설치를 위한 하드웨어 및 소프트웨어 요구 사항을 참조하십시오.
참고 항목
참조
PipelineBuffer Class
PipelineBuffer Members
Microsoft.SqlServer.Dts.Pipeline Namespace