kv_lob_read()

#include <kvstore.h>

kv_int_t
kv_lob_read(kv_lob_handle_t *handle,
            kv_long_t offset,
            kv_int_t num_bytes_to_read,
            unsigned char *buffer); 

Performs a read of a single chunk, or portion, of a LOB from the store into a buffer. The kv_lob_handle_t must have been opened for read (using kv_lob_get_for_read()) or KV_INVALID_ARGUMENT is returned. Otherwise, the number of bytes read is returned. The end of the LOB is indicated by a return value of 0. A negative return value indicates an error on the read.

Parameters

handle

The handle parameter is the LOB handle that you want to use to perform the read. It must have been created using kv_lob_get_for_read().

offset

The offset parameter is the offset into the LOB where this read is to begin.

num_bytes_to_read

The num_bytes_to_read parameter is the number of bytes you want to read from the LOB.

buffer

The buffer parameter is the user-supplied buffer into which the LOB chunk is placed. This buffer must be at least num_bytes_to_read bytes in size.

See Also

Data Operations and Related Functions