read method

int read(
  1. Uint8List data,
  2. int length, {
  3. Allocator allocator = malloc,
})

Reads data from the large object

Implementation

int read(Uint8List data, int length, {Allocator allocator = malloc}) {
  Pointer<Char> buf = allocator<Char>(length);
  for (int i = 0; i < length; i++) {
    buf[i] = data[i];
  }
  final result = psql.pq.lo_read(psql.conn, fd, buf, length);
  allocator.free(buf);
  return result;
}