fromBytes method
bytes
- the loaded bytes of the file
Implementation
@override
Future<ThreeFile> fromBytes(Uint8List bytes, [String? type, String? location]) async{
String cacheName = String.fromCharCodes(bytes).toString().substring(0,50);
final cached = Cache.get(cacheName);
if (cached != null) {
manager.itemStart(cacheName);
manager.itemEnd(cacheName);
return ThreeFile(type??'bytes',cached,'cache');
}
Cache.add(cacheName,bytes);
return ThreeFile(type??'bytes',bytes,location);
}