ByteArrayInterface#

Added in version 1.24.

class ByteArrayInterface(*args, **kwargs)#

Interface for an array of bytes. It is expected to be subclassed to implement resize virtual method using language native array implementation, such as GLib’s GByteArray, C++’s std::vector<uint8_t> or Rust’s Vec<u8>.

resize implementation could allocate more than requested to avoid repeated reallocations. It can return False, or be set to None, in the case the array cannot grow.

Fields#

class ByteArrayInterface
data#

A pointer to an array of bytes.

len#

Number of bytes in data.

resize#

Reallocate data.