1.Dd December 19, 2018 2.Dt SQLITE3_BLOB_READ 3 3.Os 4.Sh NAME 5.Nm sqlite3_blob_read 6.Nd Read Data From A BLOB Incrementally 7.Sh SYNOPSIS 8.Ft int 9.Fo sqlite3_blob_read 10.Fa "sqlite3_blob *" 11.Fa "void *Z" 12.Fa "int N" 13.Fa "int iOffset" 14.Fc 15.Sh DESCRIPTION 16This function is used to read data from an open BLOB handle 17into a caller-supplied buffer. 18N bytes of data are copied into buffer Z from the open BLOB, starting 19at offset iOffset. 20.Pp 21If offset iOffset is less than N bytes from the end of the BLOB, SQLITE_ERROR 22is returned and no data is read. 23If N or iOffset is less than zero, SQLITE_ERROR is returned 24and no data is read. 25The size of the blob (and hence the maximum value of N+iOffset) can 26be determined using the sqlite3_blob_bytes() interface. 27.Pp 28An attempt to read from an expired BLOB handle fails with 29an error code of SQLITE_ABORT. 30.Pp 31On success, sqlite3_blob_read() returns SQLITE_OK. 32Otherwise, an error code or an extended error code 33is returned. 34.Pp 35This routine only works on a BLOB handle which has been 36created by a prior successful call to sqlite3_blob_open() 37and which has not been closed by sqlite3_blob_close(). 38Passing any other pointer in to this routine results in undefined and 39probably undesirable behavior. 40.Pp 41.Sh SEE ALSO 42.Xr sqlite3_blob 3 , 43.Xr sqlite3_blob_bytes 3 , 44.Xr sqlite3_blob_close 3 , 45.Xr sqlite3_blob_open 3 , 46.Xr sqlite3_blob_write 3 , 47.Xr SQLITE_OK 3 48