| OLD | NEW | 
|---|
| 1 // Copyright (c) 2015, the Dart project authors.  Please see the AUTHORS file | 1 // Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file | 
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a | 
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. | 
| 4 | 4 | 
| 5 /// A [Resource] is data that can be read into a Dart program. | 5 /// A [Resource] is data that can be read into a Dart program. | 
| 6 /// | 6 /// | 
| 7 /// A resource is identified by a URI. It can be loaded as bytes or data. | 7 /// A resource is identified by a URI. It can be loaded as bytes or data. | 
| 8 /// The resource URI may be a `package:` URI. | 8 /// The resource URI may be a `package:` URI. | 
| 9 /// | 9 /// | 
| 10 /// Example: | 10 /// Example: | 
| 11 /// | 11 /// | 
| 12 ///     var resource = new Resource("package:foo/foo_data.txt"); | 12 ///     var resource = new Resource("package:foo/foo_data.txt"); | 
| 13 ///     var string = await resource.readAsString(UTF8); | 13 ///     var string = await resource.readAsString(UTF8); | 
| 14 ///     print(string); | 14 ///     print(string); | 
| 15 /// | 15 /// | 
| 16 /// Example: | 16 /// Example: | 
| 17 /// | 17 /// | 
| 18 ///     var resource = new Resource("http://example.com/data.json"); | 18 ///     var resource = new Resource("http://example.com/data.json"); | 
| 19 ///     var obj = await resource.openRead()   // Reads as stream of bytes. | 19 ///     var obj = await resource.openRead()   // Reads as stream of bytes. | 
| 20 ///                             .transform(UTF8.fuse(JSON).decoder) | 20 ///                             .transform(UTF8.fuse(JSON).decoder) | 
| 21 ///                             .first; | 21 ///                             .first; | 
| 22 /// | 22 /// | 
| 23 /// | 23 /// | 
| 24 /// Notice: Currently this package requires `dart:io` to do the reading, | 24 /// Notice: Currently this library requires `dart:Html` to do the reading, | 
| 25 /// so it doesn't work in the browser. | 25 /// so it doesn't work outside of a browser. | 
|  | 26 /// This library will eventually be mergeded into the `resource.dart` when | 
|  | 27 /// features are available to make that possible. | 
| 26 library resource; | 28 library resource; | 
| 27 | 29 | 
| 28 export "src/resource.dart" show Resource; | 30 export "src/browser/resource.dart" show Resource; | 
| 29 export "src/loader.dart" show ResourceLoader; | 31 export "src/browser/loader.dart" show ResourceLoader; | 
| OLD | NEW | 
|---|