Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(561)

Side by Side Diff: runtime/bin/input_stream.dart

Issue 8933029: Add pipe to input stream (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update comment Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 * Input is read from a given input stream. Such an input stream can 6 * Input is read from a given input stream. Such an input stream can
7 * be an endpoint, e.g., a socket or a file, or another input stream. 7 * be an endpoint, e.g., a socket or a file, or another input stream.
8 * Multiple input streams can be chained together to operate collaboratively 8 * Multiple input streams can be chained together to operate collaboratively
9 * on a given input. 9 * on a given input.
10 */ 10 */
(...skipping 13 matching lines...) Expand all
24 * specified the length of [buffer] is used. 24 * specified the length of [buffer] is used.
25 */ 25 */
26 int readInto(List<int> buffer, [int offset, int len]); 26 int readInto(List<int> buffer, [int offset, int len]);
27 27
28 /** 28 /**
29 * Returns the number of bytes available for immediate reading. 29 * Returns the number of bytes available for immediate reading.
30 */ 30 */
31 int available(); 31 int available();
32 32
33 /** 33 /**
34 * Pipe the content of this input stream directly to the output
35 * stream [output]. The default behavior is to close the output when
36 * all the data from the input stream have been written. Specifying
37 * [:false:] for the optional argument [close] keeps the output
38 * stream open after writing all data from the input stream. The
39 * default value for [close] is [:true:].
40 */
41 void pipe(OutputStream output, [bool close]);
42
43 /**
34 * Returns whether the stream is closed. There will be no more data 44 * Returns whether the stream is closed. There will be no more data
35 * to read. 45 * to read.
36 */ 46 */
37 bool get closed(); 47 bool get closed();
38 48
39 /** 49 /**
40 * Sets the handler that gets called when data is available. 50 * Sets the handler that gets called when data is available.
41 */ 51 */
42 void set dataHandler(void callback()); 52 void set dataHandler(void callback());
43 53
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 */ 174 */
165 void set errorHandler(void callback()); 175 void set errorHandler(void callback());
166 } 176 }
167 177
168 178
169 class StreamException implements Exception { 179 class StreamException implements Exception {
170 const StreamException([String this.message = ""]); 180 const StreamException([String this.message = ""]);
171 String toString() => "StreamException: $message"; 181 String toString() => "StreamException: $message";
172 final String message; 182 final String message;
173 } 183 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698