read method

  1. @override
Future<Uint8List?> read({
  1. int? start,
  2. int? end,
})
override

Implementation

@override
Future<Uint8List?> read({int? start, int? end}) async
{
  try
  {
    // already read
    if (bytes != null) return bytes;

    if (file is XFile)
    {
      if ((start == null) && (end == null))
      {
          bytes = await file.readAsBytes();
      }
      else {
        return await _read(start!, end);
      }
    }

    return bytes;
  }
  catch(e)
  {
    Log().exception(e);
    return null;
  }
}