Chromium Code Reviews| Index: runtime/bin/output_stream.dart |
| diff --git a/runtime/bin/output_stream.dart b/runtime/bin/output_stream.dart |
| index edcec3ded6b8b9876665131297927813655da8af..db20a167cfaeeb8dbc6ab3416dc973b8fc86ddb9 100644 |
| --- a/runtime/bin/output_stream.dart |
| +++ b/runtime/bin/output_stream.dart |
| @@ -10,10 +10,56 @@ |
| */ |
| interface OutputStream { |
| /** |
| - * Writes [len] bytes into [buffer] buffer starting at [offset] offset]. |
| - * If write succeedes true is returned. Otherwise false is returned |
| - * and [callback] callback is invoked on completion. |
| + * Writes [len] bytes from buffer [buffer] starting at offset [offset]. |
| + * When write is finished the specified callback is called. |
| */ |
| - bool write(List<int> buffer, int offset, int len, void callback()); |
| + void WriteFully(List<int> buffer, int offset, int len, void callback()) |
|
sra1
2011/10/18 23:45:51
Why is this WriteFully, not writeFully?
Is this a
Søren Gjesse
2011/10/19 14:45:41
No, that is a mistake.
|
| + |
| + /** |
| + * Writes up til [len] bytes from buffer [buffer] starting at offset |
|
sra1
2011/10/18 23:45:51
'up til' --> 'up to'
|
| + * [offset]. Returns the number of bytes written. If all data could not be |
| + * written the specified callback is called when more data can be written. |
|
sra1
2011/10/18 23:45:51
When the callback is called, has the data been wri
|
| + */ |
| + int write(List<int> buffer, int offset, int len, void callback()); |
| + |
| + /** |
| + * Close the stream. This will normally also close the underlying |
| + * communication channel. |
| + */ |
| + void close(); |
| + |
| + /** |
| + * The close handler gets called when the underlying communication |
| + * channel gets closed. Not all types of communication channels will |
| + * emit close events. |
| + */ |
| + void set closeHandler(void callback()); |
| + |
| + /** |
| + * The error handler gets called when the underlying communication |
| + * channel gets into some kind of error situation. |
| + */ |
| + void set errorHandler(void callback(StreamError error)); |
| +} |
| + |
| +interface StringOutputStream { |
| + /** |
| + * Writes [len] bytes from buffer [buffer] starting at offset [offset]. |
| + * When write is finished the specified callback is called. |
| + */ |
| + void WriteFully(String data, int offset, int len, void callback()) |
| + |
| + /** |
| + * Writes up til [len] bytes from buffer [buffer] starting at offset |
| + * [offset]. Returns the number of bytes written. If all data could not be |
| + * written the specified callback is called when more data can be written. |
| + */ |
| + int write(String data, int offset, int len, void callback()); |
| + |
| + /** |
| + * Sets the encoding to be used when writing string data to the |
| + * stream. The default encoding is UTF-8. |
| + */ |
| + void set encoding(String encoding); |
| } |