#include <db.h> int DB_STREAM->read(DB_STREAM *dbs, DBT *data, db_off_t offset, u_int32_t size, u_int32_t flags);
The DB_STREAM->read()
method reads
size bytes from the external file,
starting at offset, into the
DBT data.
The stream is created using DBC->db_stream() .
Unless otherwise specified, the
DB_STREAM->read()
method returns a non-zero error value on failure and 0 on success.
The data parameter is the DBT into which you want to place the data read using this method.
Note that the data DBT must be set with one of the following flags, or this method will return an error: DB_DBT_MALLOC, DB_DBT_REALLOC, DB_DBT_USERMEM, or DB_DBT_APPMALLOC.
The offset parameter indicates the starting position, in bytes, from the beginning of the external file where you want the read to begin.
The DB_STREAM->read()
method may fail and return one of the following non-zero errors:
The DBT provided to this method was not configured appropriately, and so there is not enough space allocated for the bytes you are trying to read.
An invalid flag value or parameter was specified; or if the DBT was configured with DB_DBT_PARTIAL.