commit | 15728b5ef6b978848e211a90b9db54c8aa67cc34 | [log] [tgz] |
---|---|---|
author | Lasse R.H. Nielsen <lrn@google.com> | Wed Feb 01 13:46:46 2017 +0100 |
committer | Lasse R.H. Nielsen <lrn@google.com> | Wed Feb 01 13:46:46 2017 +0100 |
tree | 6bce3304b9412081ae618f4067e1a40117e00525 | |
parent | 39d3a2a66eb4c4fc74e12eb1192e48e678b9e2c2 [diff] |
Address a number of open issues. Fix example in README.md (#20) Add missing import in io_io.dart (#18); Add error message when trying to load resource that cannot be resolved (#17), instead of just failing when trying to use a `null` URI. Make HttpClient be shared and reduce max number of connections to same server. Hopefully this addresses #19. If not, the program really needs more file descriptors than the OS provides. R=floitsch@google.com Review-Url: https://codereview.chromium.org//2666013004 .
Reading data from package contents and files.
A resource is data that can be read into a Dart program at runtime. A resource is identified by a URI. It can be loaded as bytes or data. The resource URI may be a package: URI.
Example:
import 'package:resource/resource.dart' show Resource; import 'dart:convert' show UTF8; main() async { var resource = new Resource("package:foo/foo_data.txt"); var string = await resource.readAsString(encoding: UTF8); print(string); }
Please check out the API docs.
Please file feature requests and bugs at the issue tracker.