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

Side by Side Diff: sdk/lib/io/io_sink.dart

Issue 1342293003: specify when a Future completes for IOSink's addStream (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: tweaks from review Created 5 years, 3 months 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 part of dart.io; 5 part of dart.io;
6 6
7 /** 7 /**
8 * Helper class to wrap a [StreamConsumer<List<int>>] and provide 8 * Helper class to wrap a [StreamConsumer<List<int>>] and provide
9 * utility functions for writing to the StreamConsumer directly. The 9 * utility functions for writing to the StreamConsumer directly. The
10 * [IOSink] buffers the input given by all [StringSink] methods and will delay 10 * [IOSink] buffers the input given by all [StringSink] methods and will delay
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 * This function must not be called when a stream is currently being added 90 * This function must not be called when a stream is currently being added
91 * using [addStream]. 91 * using [addStream].
92 * 92 *
93 * This operation is non-blocking. See [flush] or [done] for how to get any 93 * This operation is non-blocking. See [flush] or [done] for how to get any
94 * errors generated by this call. 94 * errors generated by this call.
95 */ 95 */
96 void addError(error, [StackTrace stackTrace]); 96 void addError(error, [StackTrace stackTrace]);
97 97
98 /** 98 /**
99 * Adds all elements of the given [stream] to `this`. 99 * Adds all elements of the given [stream] to `this`.
100 *
101 * Returns a [Future] that completes when
102 * all elements of the given [stream] are added to `this`.
100 */ 103 */
101 Future addStream(Stream<List<int>> stream); 104 Future addStream(Stream<List<int>> stream);
102 105
103 /** 106 /**
104 * Returns a [Future] that completes once all buffered data is accepted by the 107 * Returns a [Future] that completes once all buffered data is accepted by the
105 * to underlying [StreamConsumer]. 108 * to underlying [StreamConsumer].
106 * 109 *
107 * It's an error to call this method, while an [addStream] is incomplete. 110 * It's an error to call this method, while an [addStream] is incomplete.
108 * 111 *
109 * NOTE: This is not necessarily the same as the data being flushed by the 112 * NOTE: This is not necessarily the same as the data being flushed by the
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 299
297 void writeln([Object obj = ""]) { 300 void writeln([Object obj = ""]) {
298 write(obj); 301 write(obj);
299 write("\n"); 302 write("\n");
300 } 303 }
301 304
302 void writeCharCode(int charCode) { 305 void writeCharCode(int charCode) {
303 write(new String.fromCharCode(charCode)); 306 write(new String.fromCharCode(charCode));
304 } 307 }
305 } 308 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698