SQLiteBlob๏ƒ

Inherits: RefCounted < Object

Provides incremental read and write access to a BLOB field.

Description๏ƒ

Represents a handle to a binary large object (BLOB) stored in a database.

This class allows efficient partial reading and writing of large binary data without loading the entire value into memory.

Methods๏ƒ

void

close()

int

get_size() const

PackedByteArray

read_chunk(offset: int, length: int)

bool

write_chunk(offset: int, buffer: PackedByteArray)


Method Descriptions๏ƒ

void close() ๐Ÿ”—

Closes the BLOB handle and releases any associated resources.

The object should not be used after calling this method.


int get_size() const ๐Ÿ”—

Returns the total size of the BLOB in bytes.


PackedByteArray read_chunk(offset: int, length: int) ๐Ÿ”—

Reads a portion of the BLOB starting at offset and spanning length bytes.

Returns the read data as a PackedByteArray.

If the requested range exceeds the BLOB size, only the available data is returned.


bool write_chunk(offset: int, buffer: PackedByteArray) ๐Ÿ”—

Writes the contents of buffer into the BLOB starting at offset.

Returns true if the write operation succeeds.

Writing beyond the current BLOB size is not allowed.