| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 /** | 5 /** |
| 6 * Basic input stream which supplies binary data. | 6 * Basic input stream which supplies binary data. |
| 7 * | 7 * |
| 8 * Input streams are used to read data sequentially from some data | 8 * Input streams are used to read data sequentially from some data |
| 9 * source. All input streams are non-blocking. They each have a number | 9 * source. All input streams are non-blocking. They each have a number |
| 10 * of read calls which will always return without any IO related | 10 * of read calls which will always return without any IO related |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 */ | 53 */ |
| 54 int available(); | 54 int available(); |
| 55 | 55 |
| 56 /** | 56 /** |
| 57 * Pipe the content of this input stream directly to the output | 57 * Pipe the content of this input stream directly to the output |
| 58 * stream [output]. The default behavior is to close the output when | 58 * stream [output]. The default behavior is to close the output when |
| 59 * all the data from the input stream have been written. Specifying | 59 * all the data from the input stream have been written. Specifying |
| 60 * `false` for the optional argument [close] keeps the output | 60 * `false` for the optional argument [close] keeps the output |
| 61 * stream open after writing all data from the input stream. | 61 * stream open after writing all data from the input stream. |
| 62 */ | 62 */ |
| 63 void pipe(OutputStream output, [bool close = true]); | 63 void pipe(OutputStream output, {bool close: true}); |
| 64 | 64 |
| 65 /** | 65 /** |
| 66 * Close the underlying communication channel to avoid getting any | 66 * Close the underlying communication channel to avoid getting any |
| 67 * more data. In normal situations, where all data is read from the | 67 * more data. In normal situations, where all data is read from the |
| 68 * stream until the close handler is called, calling [close] is not | 68 * stream until the close handler is called, calling [close] is not |
| 69 * required. When [close] is used the close handler will still be | 69 * required. When [close] is used the close handler will still be |
| 70 * called. | 70 * called. |
| 71 */ | 71 */ |
| 72 void close(); | 72 void close(); |
| 73 | 73 |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 void set onError(void callback(e)); | 242 void set onError(void callback(e)); |
| 243 } | 243 } |
| 244 | 244 |
| 245 | 245 |
| 246 class StreamException implements Exception { | 246 class StreamException implements Exception { |
| 247 const StreamException([String this.message = ""]); | 247 const StreamException([String this.message = ""]); |
| 248 const StreamException.streamClosed() : message = "Stream closed"; | 248 const StreamException.streamClosed() : message = "Stream closed"; |
| 249 String toString() => "StreamException: $message"; | 249 String toString() => "StreamException: $message"; |
| 250 final String message; | 250 final String message; |
| 251 } | 251 } |
| OLD | NEW |