Chromium Code Reviews| Index: runtime/bin/input_stream.dart |
| diff --git a/runtime/bin/input_stream.dart b/runtime/bin/input_stream.dart |
| index 0f009a33a53069641b3f9edef9513a5ddf5ee51f..a9a92912c17051f02cfc25fb33f4b372dc140553 100644 |
| --- a/runtime/bin/input_stream.dart |
| +++ b/runtime/bin/input_stream.dart |
| @@ -115,6 +115,57 @@ interface StringInputStream factory _StringInputStream { |
| } |
| +interface ChunkedInputStream factory _ChunkedInputStream { |
| + /** |
| + * Decodes a binary input stream into characters using the specified |
|
Mads Ager (google)
2011/12/06 14:05:02
This looks like a copied comment. ;-)
Søren Gjesse
2011/12/07 07:58:29
Done.
|
| + * encoding. |
| + */ |
| + ChunkedInputStream(InputStream input, [int chunkSize]); |
| + |
| + /** |
| + * Reads [chunkSize] bytes from the stream. If [chunkSize] bytes are |
| + * not currently available null is returned. When the stream is |
| + * closed the last call can return with less than [chunkSize] bytes. |
| + */ |
| + List<int> read(); |
| + |
| + /** |
| + * Returns whether the stream has been closed. There might still be |
| + * more data to read. |
| + */ |
| + bool get closed(); |
| + |
| + /** |
| + * Returns the chunk size used by this stream. |
| + */ |
| + int get chunkSize(); |
| + |
| + /** |
| + * Sets the chunk size used by this stream. |
| + */ |
| + void set chunkSize(int chunkSize); |
| + |
| + /** |
| + * Sets the handler that gets called when at least [chunkSize] bytes |
| + * of data is available or the underlying stream has been closed and |
| + * there is still unread data. |
| + */ |
| + void set dataHandler(void callback()); |
| + |
| + /** |
| + * Sets the handler that gets called when there will be no more data |
| + * available in the stream. |
| + */ |
| + void set closeHandler(void callback()); |
| + |
| + /** |
| + * Sets the handler that gets called when the underlying |
| + * communication channel gets into some kind of error situation. |
| + */ |
| + void set errorHandler(void callback()); |
| +} |
| + |
| + |
| class StreamException implements Exception { |
| const StreamException([String this.message = ""]); |
| String toString() => "StreamException: $message"; |