Read 169mb video file program crash
没有提供描述。
import 'dart:io'; import 'dart:async'; import 'package:http_server/http_server.dart';
void main() { var staticFiles = new VirtualDirectory('.') ..allowDirectoryListing = true;
runZoned(() { HttpServer.bind('0.0.0.0', 7777).then((server) { print('Server running'); server.listen(staticFiles.serveRequest); }); }, onError: (e, stackTrace) => print('Oh noes! $e $stackTrace'));
Browsing the virtual directory Web page, MP4 video is not displayed, and the program directly crashes
_VirtualDirectoryFileStream has a buffer property, which is initialized to []. _VirtualDirectoryFileStream.addStream checks if the buffer is null (in which case, it will directly write the buffer to the stream), but since the buffer is never null, files are always buffered, at least as far as I can tell.
Not sure what your stack trace is, though.
I also met, what should I do? . The same"Browsing the virtual directory Web page" when i downloaded a very large file ,my app consumed a lot of memory,then crashed directly