columnBlobInto method

int columnBlobInto(
  1. int index,
  2. Uint8List target, [
  3. int offset = 0
])

Copies the value of column index, as returned by sqlite3_column_blob, into target starting at offset.

Unlike columnBlob, this doesn't allocate a new list for each value, which makes it more efficient to read many blobs into a reused buffer. Returns the number of bytes written, which is the value that columnBytes would return. Text is copied as UTF-8, and like with columnBytes, integers and floats are converted to text first. NULL values and empty blobs write nothing and return 0.

If the value doesn't fit into target after offset, a RangeError is thrown and target is left unchanged.

Note that this performs no bounds check against columnCount in Dart.

Implementation

int columnBlobInto(int index, Uint8List target, [int offset = 0]) {
  final length = rawStatement.sqlite3_column_byte_length(index);
  RangeError.checkValidRange(offset, offset + length, target.length);

  rawStatement.sqlite3_column_blob_into(index, target, offset, length);
  return length;
}