| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 * Output is written to a given output stream. Such an output stream can | 6 * Output is written to a given output stream. Such an output stream can |
| 7 * be an endpoint, e.g., a socket or a file, or another output stream. | 7 * be an endpoint, e.g., a socket or a file, or another output stream. |
| 8 * Multiple output streams can be chained together to operate collaboratively | 8 * Multiple output streams can be chained together to operate collaboratively |
| 9 * on a given output. | 9 * on a given output. |
| 10 * | 10 * |
| 11 * An output stream provides internal buffering of the data written | 11 * An output stream provides internal buffering of the data written |
| 12 * through all calls to [write] and [writeFrom] if data cannot be | 12 * through all calls to [write] and [writeFrom] if data cannot be |
| 13 * written immediately to the communication channel. The callback set | 13 * written immediately to the communication channel. The callback set |
| 14 * through [noPendingWriteHandler] can be used to to keep the rate of | 14 * through [noPendingWriteHandler] can be used to to keep the rate of |
| 15 * writing in sync with the rate the system can actually write data to | 15 * writing in sync with the rate the system can actually write data to |
| 16 * the underlying communication channel. | 16 * the underlying communication channel. |
| 17 */ | 17 */ |
| 18 interface OutputStream { | 18 interface OutputStream { |
| 19 /** | 19 /** |
| 20 * Writes the content of [buffer] to the stream. If [copyBuffer] is | 20 * Writes the content of [buffer] to the stream. If [copyBuffer] is |
| 21 * true ownership of the specified buffer is passed to the system | 21 * false ownership of the specified buffer is passed to the system |
| 22 * and the caller should not change it afterwards. The default value | 22 * and the caller should not change it afterwards. The default value |
| 23 * for [copyBuffer] is true. | 23 * for [copyBuffer] is true. |
| 24 * | 24 * |
| 25 * Returns true if the data could be written to the underlying | 25 * Returns true if the data could be written to the underlying |
| 26 * communication channel immediately. Otherwise the data is buffered | 26 * communication channel immediately. Otherwise the data is buffered |
| 27 * by the output stream and will be sent as soon as possible. | 27 * by the output stream and will be sent as soon as possible. |
| 28 */ | 28 */ |
| 29 bool write(List<int> buffer, [bool copyBuffer]); | 29 bool write(List<int> buffer, [bool copyBuffer]); |
| 30 | 30 |
| 31 /** | 31 /** |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 */ | 69 */ |
| 70 void set closeHandler(void callback()); | 70 void set closeHandler(void callback()); |
| 71 | 71 |
| 72 /** | 72 /** |
| 73 * The error handler gets called when the underlying communication | 73 * The error handler gets called when the underlying communication |
| 74 * channel gets into some kind of error situation. | 74 * channel gets into some kind of error situation. |
| 75 */ | 75 */ |
| 76 void set errorHandler(void callback()); | 76 void set errorHandler(void callback()); |
| 77 } | 77 } |
| 78 | 78 |
| OLD | NEW |