DB2Blob.Read(byte[] buff, Int64 byteOffset, Int64 numBytesToRead, Int64 smartLobOffset, DB2SmartLOBWhence whence) method

Read bytes from the BLOB object that are represented by the DB2®Blob instance.

Namespace:
IBM.Data.DB2Types
Assembly:
IBM.Data.DB2 (in IBM.Data.DB2.dll)

Syntax


[Visual Basic]
Public Function Read( _
   ByVal buff() As Byte,
   ByVal byteOffset As Long,
   ByVal numBytesToRead As Long,
   ByVal smartLobOffset As Long,
   ByVal whence As DB2SmartLOBWhence
) As Int64
[C#]
public Int64 Read(
   byte[] buff,
   Int64 byteOffset,
   Int64 numBytesToRead,
   Int64 smartLobOffset,
   DB2SmartLOBWhence whence
);
[C++]
public: __int64 Read(
   unsigned char buff __gc[],
   __int64 byteOffset,
   __int64 numBytesToRead,
   __int64 smartLobOffset,
   DB2SmartLOBWhence whence
);
[JScript]
public function Read(
   buff : Byte[],
   byteOffset : Int64,
   numBytesToRead : Int64,
   smartLobOffset : Int64,
   whence : DB2SmartLOBWhence
) : Int64;

Parameters

buff
The buffer into which to copy data.
byteOffset
The byte offset value of the buffer that indicates the start position in the buffer to which BLOB data are written.
numBytesToRead
The number of bytes to read from this BLOB object.
smartLobOffset
The byte offset value of the BLOB object from which to start reading the BLOB data.
whence
The starting position, from which smartLobOffset is counted, defined by the DB2SmartLOBWhence enumeration. For more information about the DB2SmartLOBWhence enumeration, see remarks section.

Return value

The actual number of bytes that are read.

Remarks

The BLOB object is read into the buff byte array starting at the element that is specified by the byteOffset parameter. Only bytes that are specified by the numBytesToRead parameter are read. Before the data is read, the cursor is positioned according to the values of the smartLobOffset and whence parameters.

An error is returned if the DB2Blob.Read(byte[] buff, Int64 byteOffset, Int64 numBytesToRead, Int64 smartLobOffset, DB2SmartLOBWhence whence) method writes outside the bounds of the buff byte array.

The DB2SmartLOBWhence enumeration specifies the meaning of an offset value.
public enum DB2SmartLOBWhence
   {
      Begin       =   0,
      Current     =   1,
      End         =   2
   }