Chromium Code Reviews| Index: runtime/bin/output_stream.dart |
| diff --git a/runtime/bin/output_stream.dart b/runtime/bin/output_stream.dart |
| index 8b834921aa6bd824d9c6572ca8d768a47959fc09..cee3b5061e2854b050cde17ccc91f89e2e674cac 100644 |
| --- a/runtime/bin/output_stream.dart |
| +++ b/runtime/bin/output_stream.dart |
| @@ -17,24 +17,28 @@ |
| */ |
| interface OutputStream { |
| /** |
| - * Writes the content of [buffer] to the stream. This will pass |
| - * ownership of the specified buffer to the system and the caller |
| - * should not change it. Returns true if the data could be written |
| - * to the underlying communication channel immediately. Otherwise |
| - * the data is buffered by the output stream and will be sent as |
| - * soon as possible. |
| + * Writes the content of [buffer] to the stream. If [copyBuffer] is |
| + * true ownership of the specified buffer is passed to the system |
|
Mads Ager (google)
2011/11/07 09:18:34
Really? I would have guessed that copyBuffer means
Søren Gjesse
2011/11/08 09:31:53
Of cause that was wrong. copyBuffer == true means
|
| + * and the caller should not change it afterwards. The default value |
| + * for [copyBuffer] is true. |
| + * |
| + * Returns true if the data could be written to the underlying |
| + * communication channel immediately. Otherwise the data is buffered |
| + * by the output stream and will be sent as soon as possible. |
| */ |
| - bool write(List<int> buffer); |
| + bool write(List<int> buffer, [bool copyBuffer]); |
| /** |
| * Writes [len] bytes from buffer [buffer] starting at offset |
| * [offset] to the output stream. If [offset] is not specified the |
| * default is 0. If [len] is not specified the default is the length |
| - * of the buffer passed. The system will copy the data to be written |
| - * so the caller can safely change [buffer] afterwards. Returns true |
| - * if the data could be written to the underlying communication |
| - * channel immediately. Otherwise the data is buffered by the output |
| - * stream and will be sent as soon as possible. |
| + * of the buffer minus [offset] (i.e. writing from offset to the end |
| + * of the buffer). The system will copy the data to be written so |
| + * the caller can safely change [buffer] afterwards. |
| + * |
| + * Returns true if the data could be written to the underlying |
| + * communication channel immediately. Otherwise the data is buffered |
| + * by the output stream and will be sent as soon as possible. |
| */ |
| bool writeFrom(List<int> buffer, [int offset, int len]); |