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

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

Issue 9969202: Add method flush to output stream (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 8 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 * Output streams are used to write data sequentially to a data 6 * Output streams are used to write data sequentially to a data
7 * destination e.g. a connected socket or an open file. 7 * destination e.g. a connected socket or an open file.
8 * 8 *
9 * An output stream provides internal buffering of the data written 9 * An output stream provides internal buffering of the data written
10 * through all calls to [write] and [writeFrom] if data cannot be 10 * through all calls to [write] and [writeFrom] if data cannot be
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 * Write a string to the stream using the given [encoding].The 44 * Write a string to the stream using the given [encoding].The
45 * default encoding is UTF-8 - [:Encoding.UTF_8:]. 45 * default encoding is UTF-8 - [:Encoding.UTF_8:].
46 * 46 *
47 * Returns true if the data could be written to the underlying 47 * Returns true if the data could be written to the underlying
48 * communication channel immediately. Otherwise the data is buffered 48 * communication channel immediately. Otherwise the data is buffered
49 * by the output stream and will be sent as soon as possible. 49 * by the output stream and will be sent as soon as possible.
50 */ 50 */
51 bool writeString(String string, [Encoding encoding]); 51 bool writeString(String string, [Encoding encoding]);
52 52
53 /** 53 /**
54 * Flushes data from any internal buffers as soon as possible. Note
55 * that the actual meaning of calling [flush] will depend on the
56 * actual type of the underlying communication channel.
57 */
58 void flush();
Mads Ager (google) 2012/04/17 11:56:44 Shouldn't there be some sort of notification that
Søren Gjesse 2012/04/17 13:14:19 The only reason for having flush is that even when
59
60 /**
54 * Indicate that all data has been written to the output 61 * Indicate that all data has been written to the output
55 * stream. When all data has been written to the communication 62 * stream. When all data has been written to the communication
56 * channel it will be closed. 63 * channel it will be closed.
57 */ 64 */
58 void close(); 65 void close();
59 66
60 /** 67 /**
61 * Close the communication channel immediately ignoring any buffered 68 * Close the communication channel immediately ignoring any buffered
62 * data. 69 * data.
63 */ 70 */
(...skipping 14 matching lines...) Expand all
78 */ 85 */
79 void set onClosed(void callback()); 86 void set onClosed(void callback());
80 87
81 /** 88 /**
82 * Sets the handler that gets called when the underlying 89 * Sets the handler that gets called when the underlying
83 * communication channel gets into some kind of error situation. 90 * communication channel gets into some kind of error situation.
84 */ 91 */
85 void set onError(void callback(Exception e)); 92 void set onError(void callback(Exception e));
86 } 93 }
87 94
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698