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()) |
|
dcarlson
2011/10/17 21:05:20
offset, len, and callback optional?
dcarlson
2011/10/17 21:05:20
Naming question same as InputStream.
dcarlson
2011/10/17 21:05:20
The use of the callback does seem to share the sem
rchandia
2011/10/17 21:53:46
WriteFully -> writeFully
|
| + |
| + /** |
| + * 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(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()) |
|
rchandia
2011/10/17 21:53:46
writeFully
|
| + |
| + /** |
| + * 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); |
|
dcarlson
2011/10/17 21:05:20
Getter? same as StringInputStream.
|
| } |