| Index: runtime/bin/file.dart
|
| diff --git a/runtime/bin/file.dart b/runtime/bin/file.dart
|
| index 48687f6a91a0874c20ec03ee6248b4c13ba594a0..ee480b9bbe0ccc7817fa9a1b1d680449a9bb83fd 100644
|
| --- a/runtime/bin/file.dart
|
| +++ b/runtime/bin/file.dart
|
| @@ -176,6 +176,54 @@ interface File default _File {
|
| OutputStream openOutputStreamSync([FileMode mode]);
|
|
|
| /**
|
| + * Read the entire file contents as a list of bytes. When the
|
| + * operation completes the [readAsBytesHandler] is called.
|
| + * The [errorHandler] is called if the operation fails.
|
| + */
|
| + void readAsBytes();
|
| +
|
| + /**
|
| + * Synchronously read the entire file contents as a list of bytes.
|
| + */
|
| + List<int> readAsBytesSync();
|
| +
|
| + /**
|
| + * Read the entire file contents as text using the give [encoding]
|
| + * ('UTF-8', 'ISO-8859-1', 'ASCII'). By default the encoding is
|
| + * 'UTF-8'.
|
| + *
|
| + * When the operation completes the [readAsTextHandler] is called
|
| + * with the resulting string. The [errorHandler] is called if the
|
| + * operation fails.
|
| + */
|
| + void readAsText([String encoding]);
|
| +
|
| + /**
|
| + * Synchronously read the entire file contents as text using the
|
| + * give [encoding] ('UTF-8', 'ISO-8859-1', 'ASCII'). By default the
|
| + * encoding is 'UTF-8'.
|
| + */
|
| + String readAsTextSync([String encoding]);
|
| +
|
| + /**
|
| + * Read the entire file contents as lines of text using the give
|
| + * [encoding] ('UTF-8', 'ISO-8859-1', 'ASCII'). By default the
|
| + * encoding is 'UTF-8'.
|
| + *
|
| + * When the operation completes the [readAsLinesHandler] is called
|
| + * with the resulting string. The [errorHandler] is called if the
|
| + * operation fails.
|
| + */
|
| + void readAsLines();
|
| +
|
| + /**
|
| + * Synchronously read the entire file contents as lines of text
|
| + * using the give [encoding] ('UTF-8', 'ISO-8859-1', 'ASCII'). By
|
| + * default the encoding is 'UTF-8'.
|
| + */
|
| + List<String> readAsLinesSync([String encoding]);
|
| +
|
| + /**
|
| * Get the name of the file.
|
| */
|
| String get name();
|
| @@ -223,6 +271,24 @@ interface File default _File {
|
| void set outputStreamHandler(void handler(OutputStream stream));
|
|
|
| /**
|
| + * Set the handler that gets called when a [readAsBytes] operation
|
| + * completes.
|
| + */
|
| + void set readAsBytesHandler(void handler(List<int> bytes));
|
| +
|
| + /**
|
| + * Set the handler that gets called when a [readAsText] operation
|
| + * completes.
|
| + */
|
| + void set readAsTextHandler(void handler(String text));
|
| +
|
| + /**
|
| + * Set the handler that gets called when a [readAsLines] operation
|
| + * completes.
|
| + */
|
| + void set readAsLinesHandler(void handler(List<String> lines));
|
| +
|
| + /**
|
| * Sets the handler that gets called when a [fullPath] operation
|
| * completes.
|
| */
|
|
|