Skip to content

Blob/bytes

Aerospike supports two main types of Blob/bytes bins. There are general purpose Blob bins and language-specific Blob bins.

The general purpose Blob bins are byte arrays of a specific size. Any binary data of any type can be stored in a Blob bin. They also support Bitwise Operations.

Language-specific Blob bins are only accessible from the client library language that wrote them. These are useful for serializing objects in that language to the Aerospike database.

Bitwise Operations

Aerospike supports a rich set of bitwise operations which can be used on the Blob data type. These operations allow an application to manipulate a large Blob bin on the server without needing to pull the entire blob to the client, saving bandwidth.

The examples throughout this page use a 5-byte Blob bin called flags with the value [0x01, 0x42, 0xB0, 0x04, 0x05], representing an IoT device configuration record. Bits 0-15 store a 16-bit device ID, byte 2 holds capability flags, and the remaining bytes hold status and version data.

NameValueDescription
create_only0x01Disallow updating an existing value of this bin.
update_only0x02Disallow creation of a new Blob bin.
no_fail0x04If the operation should fail, continue as if it had succeeded.
partial0X08If the number of bytes from the offset to the end of the existing Blob bin is less than the specified number of bytes, then only apply the operations from the offset to the end.

Modify operations

add

update_only no_fail
add(policy, bin_name, bit_offset, n_bits, value, signed, action)
Description

Treat the n_bits bits beginning at offset in the Blob bin as an n_bits bit integer and add the integer value to it - the integer value will be converted to an n_bits bit integer. By default, fail if the result overflows. Integers in the Blob bin are stored and interpreted as big-endian integers.

Arguments
NameTypeDescription
policy library_specific

Bitwise modify policy.

bin_name string

Name of bin.

bit_offset integer

Offset (in bits) to the first bit to apply operation.

n_bits integer

Size of the integer in bits (maximum of 64 bits).

value integer

The unsigned integer value to be added.

signed boolean

Read the integer from the Blob bin as signed (true) or unsigned (false).

action client_specific

How to handle integer overflow.

  • (Default) Fail transaction on overflow.
  • Set maximum value on overflow.
  • Wrap the value from the min value.
Returns
none
Examples
Increment the device ID

An IoT device stores its configuration in a 5-byte Blob bin called flags. Bits 0-15 hold a 16-bit device ID stored as a big-endian unsigned integer. The add operation increments this integer in place on the server, avoiding a read-modify-write round trip.

Given flags = [0x01, 0x42, 0xB0, 0x04, 0x05], the first 16 bits represent 0x0142 (decimal 322). Calling add("flags", 0, 16, 10) adds 10 to get 332 (0x014C). The result is flags = [0x01, 0x4C, 0xB0, 0x04, 0x05].

Code sample
// flags = [0x01, 0x42, 0xB0, 0x04, 0x05]
// bits 0-15: 0x0142 (322) + 10 = 0x014C (332)
import com.aerospike.client.operation.BitOverflowAction;
Record record = client.operate(null, key,
BitOperation.add(BitPolicy.Default, "flags", 0, 16,
10, false, BitOverflowAction.FAIL));
// flags = [0x01, 0x4C, 0xB0, 0x04, 0x05]

and

update_only no_fail partial
and(policy, bin_name, bit_offset, n_bits, value)
Description

Bitwise AND n_bits of the buffer with the leading n_bits of the Blob bin starting from the specified offset (in bits).

Arguments
NameTypeDescription
policy library_specific

Bitwise modify policy.

bin_name string

Name of bin.

bit_offset integer

Offset (in bits) to the first bit to apply operation.

n_bits integer

Number of bits to apply operation to.

value bytes

Buffer containing at least n_bits bits.

Returns
none
Examples
Mask the lower nibble of a capability byte

An IoT device stores its configuration in a 5-byte Blob bin called flags. Byte 0 (bits 0-7) holds a device type identifier. ANDing with a mask clears specific bits while preserving others.

Given flags = [0x01, 0x42, 0xB0, 0x04, 0x05], calling and("flags", 0, 8, [0xF0]) masks the first byte with 0xF0 (1111 0000). This clears the lower four bits: 0x01 AND 0xF0 = 0x00. The result is flags = [0x00, 0x42, 0xB0, 0x04, 0x05].

Code sample
// flags = [0x01, 0x42, 0xB0, 0x04, 0x05]
Record record = client.operate(null, key,
BitOperation.and(BitPolicy.Default, "flags", 0, 8,
new byte[] {(byte) 0xF0}));
// flags = [0x00, 0x42, 0xB0, 0x04, 0x05]

insert

create_only update_only no_fail
insert(policy, bin_name, byte_offset, value)
Description

Inserts bytes at the specified byte_offset with the contents of buffer.

Arguments
NameTypeDescription
policy library_specific

Bitwise modify policy.

bin_name string

Name of bin.

byte_offset integer

Offset to location of insertion.

value bytes

Bytes to be inserted.

Returns
none
Examples
Insert extra status bytes

An IoT device stores its configuration in a 5-byte Blob bin called flags. To add two new bytes of status data in the middle of the blob, use insert at a byte offset. Existing bytes after the offset shift to the right, growing the blob.

Given flags = [0x01, 0x42, 0xB0, 0x04, 0x05] (5 bytes), calling insert("flags", 2, [0xAA, 0xBB]) inserts 0xAA 0xBB at byte offset 2. The result is flags = [0x01, 0x42, 0xAA, 0xBB, 0xB0, 0x04, 0x05] (7 bytes).

Code sample
// flags = [0x01, 0x42, 0xB0, 0x04, 0x05] (5 bytes)
Record record = client.operate(null, key,
BitOperation.insert(BitPolicy.Default, "flags", 2,
new byte[] {(byte) 0xAA, (byte) 0xBB}));
// flags = [0x01, 0x42, 0xAA, 0xBB, 0xB0, 0x04, 0x05] (7 bytes)

lshift

update_only no_fail partial
lshift(policy, bin_name, bit_offset, n_bits, shift)
Description

Bitwise shift n_bits bits of the Blob bin n_bits to the left starting at the specified offset (in bits).

Arguments
NameTypeDescription
policy library_specific

Bitwise modify policy.

bin_name string

Name of bin.

bit_offset integer

Offset (in bits) to the first bit to apply operation.

n_bits integer

Number of bits to apply operation to.

shift integer

Number of bits to shift.

Returns
none
Examples
Shift the device ID left

An IoT device stores its configuration in a 5-byte Blob bin called flags. Bits 0-15 hold a 16-bit device ID. Left-shifting multiplies the value by a power of 2. Bits shifted out on the left are lost, and zeros fill in on the right.

Given flags = [0x01, 0x42, 0xB0, 0x04, 0x05], the first two bytes are 0x0142 (decimal 322). Calling lshift("flags", 0, 16, 3) shifts the 16-bit field left by 3: 0x0142 << 3 = 0x0A10 (decimal 2576). The result is flags = [0x0A, 0x10, 0xB0, 0x04, 0x05].

Code sample
// flags = [0x01, 0x42, 0xB0, 0x04, 0x05]
// bits 0-15: 0x0142 (322) << 3 = 0x0A10 (2576)
Record record = client.operate(null, key,
BitOperation.lshift(BitPolicy.Default, "flags", 0, 16, 3));
// flags = [0x0A, 0x10, 0xB0, 0x04, 0x05]

not

update_only no_fail partial
not(policy, bin_name, bit_offset, n_bits)
Description

Bitwise NOT n_bits of the Blob bin starting from the specified offset (in bits).

Arguments
NameTypeDescription
policy library_specific

Bitwise modify policy.

bin_name string

Name of bin.

bit_offset integer

Offset (in bits) to the first bit to apply operation.

n_bits integer

Number of bits to apply operation to.

Returns
none
Examples
Invert a device type byte

An IoT device stores its configuration in a 5-byte Blob bin called flags. NOT inverts every bit in the specified range, flipping 0s to 1s and 1s to 0s.

Given flags = [0x01, 0x42, 0xB0, 0x04, 0x05], calling not("flags", 0, 8) inverts the first byte: NOT 0x01 (0000 0001) = 0xFE (1111 1110). The result is flags = [0xFE, 0x42, 0xB0, 0x04, 0x05].

Code sample
// flags = [0x01, 0x42, 0xB0, 0x04, 0x05]
Record record = client.operate(null, key,
BitOperation.not(BitPolicy.Default, "flags", 0, 8));
// flags = [0xFE, 0x42, 0xB0, 0x04, 0x05]

or

update_only no_fail partial
or(policy, bin_name, bit_offset, n_bits, value)
Description

Bitwise OR n_bits of the buffer with the leading n_bits of the Blob bin starting from the specified offset (in bits).

Arguments
NameTypeDescription
policy library_specific

Bitwise modify policy.

bin_name string

Name of bin.

bit_offset integer

Offset (in bits) to the first bit to apply operation.

n_bits integer

Number of bits to apply operation to.

value bytes

Buffer containing at least n_bits bits.

Returns
none
Examples
Enable a feature flag

An IoT device stores its configuration in a 5-byte Blob bin called flags. Byte 0 (bits 0-7) holds a device type identifier. ORing with a value sets specific bits without affecting others.

Given flags = [0x00, 0x42, 0xB0, 0x04, 0x05], calling or("flags", 0, 8, [0x01]) sets the lowest bit in the first byte: 0x00 OR 0x01 = 0x01. The result is flags = [0x01, 0x42, 0xB0, 0x04, 0x05].

Code sample
// flags = [0x00, 0x42, 0xB0, 0x04, 0x05]
Record record = client.operate(null, key,
BitOperation.or(BitPolicy.Default, "flags", 0, 8,
new byte[] {0x01}));
// flags = [0x01, 0x42, 0xB0, 0x04, 0x05]

remove

update_only no_fail partial
remove(policy, bin_name, byte_offset, n_bytes)
Description

Remove n_bytes bytes beginning at the specified byte_offset.

Arguments
NameTypeDescription
policy library_specific

Bitwise modify policy.

bin_name string

Name of bin.

byte_offset integer

Offset to location of removal.

n_bytes integer

Number of bytes to remove.

Returns
none
Examples
Remove bytes from the middle

An IoT device stores its configuration in a 5-byte Blob bin called flags. To remove bytes from the middle of the blob, use remove at a byte offset with a count. Bytes after the removed range shift left, shrinking the blob.

Given flags = [0x01, 0x42, 0xB0, 0x04, 0x05] (5 bytes), calling remove("flags", 2, 2) removes 2 bytes starting at byte offset 2 (bytes 0xB0 and 0x04). The result is flags = [0x01, 0x42, 0x05] (3 bytes).

Code sample
// flags = [0x01, 0x42, 0xB0, 0x04, 0x05] (5 bytes)
Record record = client.operate(null, key,
BitOperation.remove(BitPolicy.Default, "flags", 2, 2));
// flags = [0x01, 0x42, 0x05] (3 bytes)

resize

create_only update_only no_fail
resize(policy, bin_name, n_bytes, resize_flags)
Description

Specify the size of the Blob bin to be n_bytes. This operation may (by default) create a new Bytes bin or extend or trim an existing Byte bin to the specified size of n_bytes. By default the resize operation will extend or trim from the end of the Blob bin.

Arguments
NameTypeDescription
policy library_specific

Bitwise modify policy.

bin_name string

Name of bin.

n_bytes integer

Number of bytes to resize to.

resize_flags integer
NameValueDescription
from_front0x01Extend or trim the Blob bin from the beginning instead of the end.
grow_only0x02Disallow trimming existing objects.
shrink_only0x04Disallow extending existing objects.
Returns
none
Examples
Extend the blob to accommodate new fields

An IoT device stores its configuration in a 5-byte Blob bin called flags. When the device schema grows to include additional fields, resize extends the blob to the new size. New bytes are initialized to zero and appended at the end by default.

Given flags = [0x01, 0x42, 0xB0, 0x04, 0x05] (5 bytes), calling resize("flags", 10, 0) extends the blob to 10 bytes. The result is flags = [0x01, 0x42, 0xB0, 0x04, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00].

Code sample
// flags = [0x01, 0x42, 0xB0, 0x04, 0x05] (5 bytes)
Record record = client.operate(null, key,
BitOperation.resize(BitPolicy.Default, "flags", 10, 0));
// flags = [0x01, 0x42, 0xB0, 0x04, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00] (10 bytes)

rshift

update_only no_fail partial
rshift(policy, bin_name, bit_offset, n_bits, shift)
Description

Bitwise shift n_bits bits of the Blob bin n_bits to the right starting at the specified offset (in bits).

Arguments
NameTypeDescription
policy library_specific

Bitwise modify policy.

bin_name string

Name of bin.

bit_offset integer

Offset (in bits) to the first bit to apply operation.

n_bits integer

Number of bits to apply operation to.

shift integer

Number of bits to shift.

Returns
none
Examples
Shift the device ID right

An IoT device stores its configuration in a 5-byte Blob bin called flags. Bits 0-15 hold a 16-bit device ID. Right-shifting divides the value by a power of 2. Bits shifted out on the right are lost, and zeros fill in on the left.

Given flags = [0x01, 0x42, 0xB0, 0x04, 0x05], the first two bytes are 0x0142 (decimal 322). Calling rshift("flags", 0, 16, 3) shifts the 16-bit field right by 3: 0x0142 >> 3 = 0x0028 (decimal 40). The result is flags = [0x00, 0x28, 0xB0, 0x04, 0x05].

Code sample
// flags = [0x01, 0x42, 0xB0, 0x04, 0x05]
// bits 0-15: 0x0142 (322) >> 3 = 0x0028 (40)
Record record = client.operate(null, key,
BitOperation.rshift(BitPolicy.Default, "flags", 0, 16, 3));
// flags = [0x00, 0x28, 0xB0, 0x04, 0x05]

set

update_only no_fail partial
set(policy, bin_name, bit_offset, n_bits, value)
Description

Overwrites n_bits bits at the specified offset (in bits) with the first n_bits of value.

Arguments
NameTypeDescription
policy library_specific

Bitwise modify policy.

bin_name string

Name of bin.

bit_offset integer

Offset (in bits) to the first bit to overwrite.

n_bits integer

Number of bits to overwrite.

value bytes

Buffer containing at least n_bits bits to be written. Bits are taken in order from the beginning of the buffer.

Returns
none
Examples
Set all capability flags at once

An IoT device stores its configuration in a 5-byte Blob bin called flags. Byte 2 (bits 16-23) holds capability flags. To enable all capabilities at once, overwrite that byte with 0xFF.

Given flags = [0x01, 0x42, 0xB0, 0x04, 0x05], calling set("flags", 16, 8, [0xFF]) replaces byte 2 with 0xFF (1111 1111), turning on every capability bit. The result is flags = [0x01, 0x42, 0xFF, 0x04, 0x05].

Code sample
// flags = [0x01, 0x42, 0xB0, 0x04, 0x05]
Record record = client.operate(null, key,
BitOperation.set(BitPolicy.Default, "flags", 16, 8,
new byte[] {(byte) 0xFF}));
// flags = [0x01, 0x42, 0xFF, 0x04, 0x05]

set_int

update_only no_fail
set_int(policy, bin_name, bit_offset, n_bits, value)
Description

Overwrite n_bits bits at offset offset with uint64 converted to an n_bits bit big_endian integer.

Arguments
NameTypeDescription
policy library_specific

Bitwise modify policy.

bin_name string

Name of bin.

bit_offset integer

Offset (in bits) to the first bit to apply operation.

n_bits integer

Size of the integer in bits (maximum of 64 bits).

value integer

The unsigned integer value to be set.

Returns
none
Examples
Set the device ID to a known value

An IoT device stores its configuration in a 5-byte Blob bin called flags. Bits 0-15 hold a 16-bit device ID. Instead of computing the raw bytes for a new ID, set_int writes an integer directly.

Given flags = [0x01, 0x42, 0xB0, 0x04, 0x05], calling set_int("flags", 0, 16, 500) writes 500 (0x01F4) into the first 16 bits as a big-endian integer. The result is flags = [0x01, 0xF4, 0xB0, 0x04, 0x05].

Code sample
// flags = [0x01, 0x42, 0xB0, 0x04, 0x05]
// 500 = 0x01F4
Record record = client.operate(null, key,
BitOperation.setInt(BitPolicy.Default, "flags", 0, 16, 500));
// flags = [0x01, 0xF4, 0xB0, 0x04, 0x05]

subtract

update_only no_fail
subtract(policy, bin_name, bit_offset, n_bits, value, signed, action)
Description

Treat the n_bits bits beginning at offset in the Blob bin as an n_bits bit integer and subtract the integer uint64 from it - the integer uint64 will be converted to an n_bits bit integer. By default, fail if the result underflows. Integers in the Blob bin are stored and interpreted as big-endian integers.

Arguments
NameTypeDescription
policy library_specific

Bitwise modify policy.

bin_name string

Name of bin.

bit_offset integer

Offset (in bits) to the first bit to apply operation.

n_bits integer

Size of the integer in bits (maximum of 64 bits).

value integer

The unsigned integer value to be subtracted.

signed boolean

Read the integer from the Blob bin as signed (true) or unsigned (false).

action client_specific

How to handle integer underflow.

  • (Default) Fail transaction on underflow.
  • Set minimum value on underflow.
  • Wrap the value from the max value.
Returns
none
Examples
Decrement the device ID

An IoT device stores its configuration in a 5-byte Blob bin called flags. Bits 0-15 hold a 16-bit device ID stored as a big-endian unsigned integer. The subtract operation decrements this integer in place on the server.

Given flags = [0x01, 0x42, 0xB0, 0x04, 0x05], the first 16 bits represent 0x0142 (decimal 322). Calling subtract("flags", 0, 16, 5) subtracts 5 to get 317 (0x013D). The result is flags = [0x01, 0x3D, 0xB0, 0x04, 0x05].

Code sample
// flags = [0x01, 0x42, 0xB0, 0x04, 0x05]
// bits 0-15: 0x0142 (322) - 5 = 0x013D (317)
import com.aerospike.client.operation.BitOverflowAction;
Record record = client.operate(null, key,
BitOperation.subtract(BitPolicy.Default, "flags", 0, 16,
5, false, BitOverflowAction.FAIL));
// flags = [0x01, 0x3D, 0xB0, 0x04, 0x05]

xor

update_only no_fail partial
xor(policy, bin_name, bit_offset, n_bits, value)
Description

Bitwise XOR n_bits of the buffer with the leading n_bits of the Blob bin starting from the specified offset (in bits).

Arguments
NameTypeDescription
policy library_specific

Bitwise modify policy.

bin_name string

Name of bin.

bit_offset integer

Offset (in bits) to the first bit to apply operation.

n_bits integer

Number of bits to apply operation to.

value bytes

Buffer containing at least n_bits bits.

Returns
none
Examples
Toggle the lower nibble of a byte

An IoT device stores its configuration in a 5-byte Blob bin called flags. XOR flips the bits where the mask has 1s, leaving other bits unchanged. This is useful for toggling specific flags.

Given flags = [0x01, 0x42, 0xB0, 0x04, 0x05], calling xor("flags", 0, 8, [0x0F]) flips the lower four bits of the first byte: 0x01 XOR 0x0F = 0x0E (0000 0001 XOR 0000 1111 = 0000 1110). The result is flags = [0x0E, 0x42, 0xB0, 0x04, 0x05].

Code sample
// flags = [0x01, 0x42, 0xB0, 0x04, 0x05]
Record record = client.operate(null, key,
BitOperation.xor(BitPolicy.Default, "flags", 0, 8,
new byte[] {0x0F}));
// flags = [0x0E, 0x42, 0xB0, 0x04, 0x05]

Read operations

count

update_only no_fail
count(bin_name, bit_offset, n_bits)
Description

Count the number of bits set to 1 in the n_bits beginning at offset.

Arguments
NameTypeDescription
bin_name string

Name of bin.

bit_offset integer

Offset (in bits) to the first bit to be checked.

n_bits integer

Number of bits to check.

Returns
bytes
Examples
Count enabled capabilities

An IoT device stores its configuration in a 5-byte Blob bin called flags. Bits 0-15 hold a 16-bit device ID. To find out how many bits are set in the device ID field, use count at offset 0 for 16 bits.

Given flags = [0x01, 0x42, 0xB0, 0x04, 0x05], the first two bytes are 0x01 0x42 (0000 0001 0100 0010 in binary). Calling count("flags", 0, 16) returns 4 — four bits are set in the device ID field.

Code sample
// flags = [0x01, 0x42, 0xB0, 0x04, 0x05]
// bits 0-15: 0000 0001 0100 0010
Record record = client.operate(null, key,
BitOperation.count("flags", 0, 16));
// returns 4

get

update_only no_fail
get(bin_name, bit_offset, n_bits)
Description

Retrieve n_bits bits beginning at offset offset. If n_bits is not a multiple of 8 then there will be n_bits modulo 8 zeroed bits padding the end.

Arguments
NameTypeDescription
bin_name string

Name of bin.

bit_offset integer

Offset (in bits) to the first bit to be retrieved.

n_bits integer

Number of bits to retrieve.

Returns
bytes
Examples
Read the capability flags byte

An IoT device record stores its configuration in a 5-byte Blob bin called flags. Byte 2 (bits 16-23) holds capability flags such as WiFi, Bluetooth, and GPS. To read just that byte without transferring the entire blob, use get at bit offset 16 for 8 bits.

Given flags = [0x01, 0x42, 0xB0, 0x04, 0x05], calling get("flags", 16, 8) returns [0xB0] — the single capability byte.

Code sample
// flags = [0x01, 0x42, 0xB0, 0x04, 0x05]
Record record = client.operate(null, key,
BitOperation.get("flags", 16, 8));
// returns [0xB0]

get_integer

update_only no_fail
get_integer(bin_name, bit_offset, n_bits, signed)
Description

Retrieve the n_bits bit big-endian integer beginning at offset offset as a 64 bit integer.

Arguments
NameTypeDescription
bin_name string

Name of bin.

bit_offset integer

Offset (in bits) to the first bit to be retrieved

n_bits integer

Number of bits to retrieve.

signed boolean

If true, treat the value at offset as a signed n_bit bit integer, otherwise treat value as unsigned.

Returns
integer
Examples
Read the device ID as an integer

An IoT device stores its configuration in a 5-byte Blob bin called flags. Bits 0-15 hold a 16-bit device ID stored as a big-endian integer. To read the device ID as a number, use get_integer at offset 0 for 16 bits.

Given flags = [0x01, 0x42, 0xB0, 0x04, 0x05], calling get_integer("flags", 0, 16, false) returns 322 (0x0142 as an unsigned 16-bit integer).

Code sample
// flags = [0x01, 0x42, 0xB0, 0x04, 0x05]
Record record = client.operate(null, key,
BitOperation.getInt("flags", 0, 16, false));
// returns 322 (0x0142 unsigned)

lscan

update_only no_fail
lscan(bin_name, bit_offset, n_bits, value)
Description

Return the position relative to the offset of the first bit set to value searching from offset plus n_bits to offset. If the value isn’t found, returns -1.

Arguments
NameTypeDescription
bin_name string

Name of bin.

bit_offset integer

Offset (in bits) to the first (leftmost) bit to be scanned.

n_bits integer

Number of bits from the offset to scan.

value boolean

If true, search for the first set bit. If false, search for the first unset bit.

Returns
integer
Examples
Find the first set bit in the blob

An IoT device stores its configuration in a 5-byte (40-bit) Blob bin called flags. To find the position of the first set bit across the entire blob, use lscan from offset 0 for all 40 bits, searching left to right.

Given flags = [0x01, 0x42, 0xB0, 0x04, 0x05], the first byte 0x01 is 0000 0001. Calling lscan("flags", 0, 40, true) returns 7 — the first set bit is at position 7 (the least-significant bit of the first byte).

Code sample
// flags = [0x01, 0x42, 0xB0, 0x04, 0x05]
Record record = client.operate(null, key,
BitOperation.lscan("flags", 0, 40, true));
// returns 7 (first set bit is at position 7)

rscan

update_only no_fail
rscan(bin_name, bit_offset, n_bits, value)
Description

Return the position relative to the offset of the first bit set to value searching from offset to offset plus n_bits. If the value isn’t found, returns -1.

Arguments
NameTypeDescription
bin_name string

Name of bin.

bit_offset integer

Offset (in bits) to the first (leftmost) bit to be scanned.

n_bits integer

Number of bits from the offset to scan.

value boolean

If true, search for the first set bit. If false, search for the first unset bit.

Returns
integer
Examples
Find the last set bit in the blob

An IoT device stores its configuration in a 5-byte (40-bit) Blob bin called flags. To find the position of the last set bit across the entire blob, use rscan from offset 0 for all 40 bits, searching right to left.

Given flags = [0x01, 0x42, 0xB0, 0x04, 0x05], the last byte 0x05 is 0000 0101. Calling rscan("flags", 0, 40, true) returns 37 — the last set bit is at position 37 (bit index 37, counting from bit 0 at the left).

Code sample
// flags = [0x01, 0x42, 0xB0, 0x04, 0x05]
Record record = client.operate(null, key,
BitOperation.rscan("flags", 0, 40, true));
// returns 37 (last set bit is at position 37)
Feedback

Was this page helpful?

What type of feedback are you giving?

What would you like us to know?

+Capture screenshot

Can we reach out to you?