read method
Read data from the LOB
For CLOB/NCLOB, returns a String. For BLOB/BFILE, returns a Uint8List.
Parameters:
offset: Start position (1-based, default: 1)amount: Number of bytes/characters to read (default: read all)
Implementation
Future<dynamic> read({int offset = 1, int? amount}) async {
_ensureNotDisposed();
final lobSize = await size();
// Calculate how much to read
final readAmount = amount ?? (lobSize - offset + 1);
if (_lobType == LobType.blob || _lobType == LobType.bfile) {
return _readBytes(offset, readAmount);
} else {
return _readString(offset, readAmount);
}
}