| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 part of dart.core; | 5 part of dart.core; |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * A resource that can be read into the program. | 8 * A resource that can be read into the program. |
| 9 * | 9 * |
| 10 * WARNING: This API is _experimental_, |
| 11 * and it may be changed or removed in future releases |
| 12 * |
| 10 * A resource is data that can be located using a URI and read into | 13 * A resource is data that can be located using a URI and read into |
| 11 * the program at runtime. | 14 * the program at runtime. |
| 12 * The URI may use the `package` scheme to read resources provided | 15 * The URI may use the `package` scheme to read resources provided |
| 13 * along with package sources. | 16 * along with package sources. |
| 14 */ | 17 */ |
| 15 abstract class Resource { | 18 abstract class Resource { |
| 16 /** | 19 /** |
| 17 * Creates a resource object with the given [uri] as location. | 20 * Creates a resource object with the given [uri] as location. |
| 18 * | 21 * |
| 19 * The `uri` is a string containing a valid URI. | 22 * The `uri` is a string containing a valid URI. |
| (...skipping 23 matching lines...) Expand all Loading... |
| 43 Future<List<int>> readAsBytes(); | 46 Future<List<int>> readAsBytes(); |
| 44 | 47 |
| 45 /** | 48 /** |
| 46 * Read the resource content as a string. | 49 * Read the resource content as a string. |
| 47 * | 50 * |
| 48 * The content is decoded into a string using an [Encoding]. | 51 * The content is decoded into a string using an [Encoding]. |
| 49 * If no other encoding is provided, it defaults to UTF-8. | 52 * If no other encoding is provided, it defaults to UTF-8. |
| 50 */ | 53 */ |
| 51 Future<String> readAsString({Encoding encoding}); | 54 Future<String> readAsString({Encoding encoding}); |
| 52 } | 55 } |
| OLD | NEW |