loadBlobIntoBuffer method

  1. @override
void loadBlobIntoBuffer(
  1. TFieldDef fieldDef,
  2. PBufBlobField aBlobBuf,
  3. TSQLCursor cursor,
  4. TSQLTransaction? aTransaction,
)
override

Implementation

@override
void loadBlobIntoBuffer(TFieldDef fieldDef, PBufBlobField aBlobBuf,
    TSQLCursor cursor, TSQLTransaction? aTransaction) {
  final c = cursor as TWapCursor;
  final v =
      (c.rowIndex >= 0 && c.rowIndex < c.rows.length)
          ? c.rows[c.rowIndex][fieldDef.name]
          : null;
  final bb = TBlobBuffer();
  if (v is Uint8List) {
    bb.buffer = v;
    bb.size = v.length;
  } else if (v is String) {
    bb.buffer = Uint8List.fromList(v.codeUnits);
    bb.size = v.length;
  } else {
    bb.buffer = Uint8List(0);
    bb.size = 0;
  }
  aBlobBuf.blobBuffer = bb;
}