k2hpx_da_set_value k2hash Functions k2hpx_disable_transaction

k2hpx_da_set_write_offset

Sets value using the offset

Description

int k2hpx_da_set_write_offset ( mixed $dahandle_res , int $offset )

Sets value using the offset.

Note

The k2hash direct access handle is a handler to provide quick access to the specific part of large data using offset.

Parameters

Return Values

Returns true on success or false on failure.

Examples

<?php
$handle = k2hpx_open_mem();
k2hpx_set_value($handle, "test", "value");
$dahandle = k2hpx_da_get_handle_rw($handle, "test");
var_dump(k2hpx_da_get_offset($dahandle));
var_dump(k2hpx_da_set_write_offset($dahandle, 5));
var_dump(k2hpx_da_get_offset($dahandle));
k2hpx_da_free($dahandle);
k2hpx_close($handle);
?>

The above example will output:

array(2) {
  [0]=>
  int(0)
  [1]=>
  int(0)
}
bool(true)
array(2) {
  [0]=>
  int(0)
  [1]=>
  int(5)
}

See Also

k2hpx_da_set_value k2hash Functions k2hpx_disable_transaction