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

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

Issue 12870003: Make argument to StringSink.writeln optional. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Minor fix. Created 7 years, 9 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
« no previous file with comments | « sdk/lib/io/http_impl.dart ('k') | utils/pub/http.dart » ('j') | 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>, T>] and provide 8 * Helper class to wrap a [StreamConsumer<List<int>, T>] 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 [write], [writeAll], [writeln], 10 * [IOSink] buffers the input given by [write], [writeAll], [writeln],
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 } 91 }
92 } 92 }
93 if (string.isEmpty) return; 93 if (string.isEmpty) return;
94 writeBytes(_encodeString(string, _encoding)); 94 writeBytes(_encodeString(string, _encoding));
95 } 95 }
96 96
97 void writeAll(Iterable objects) { 97 void writeAll(Iterable objects) {
98 for (Object obj in objects) write(obj); 98 for (Object obj in objects) write(obj);
99 } 99 }
100 100
101 void writeln(Object obj) { 101 void writeln([Object obj = ""]) {
102 write(obj); 102 write(obj);
103 write("\n"); 103 write("\n");
104 } 104 }
105 105
106 void writeCharCode(int charCode) { 106 void writeCharCode(int charCode) {
107 write(new String.fromCharCode(charCode)); 107 write(new String.fromCharCode(charCode));
108 } 108 }
109 109
110 void writeBytes(List<int> data) { 110 void writeBytes(List<int> data) {
111 if (_isBound) { 111 if (_isBound) {
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 }, 225 },
226 onError: _controller.addError); 226 onError: _controller.addError);
227 if (_paused) _pause(); 227 if (_paused) _pause();
228 if (unbind) { 228 if (unbind) {
229 return _writeStreamCompleter.future; 229 return _writeStreamCompleter.future;
230 } else { 230 } else {
231 return _pipeFuture; 231 return _pipeFuture;
232 } 232 }
233 } 233 }
234 } 234 }
OLDNEW
« no previous file with comments | « sdk/lib/io/http_impl.dart ('k') | utils/pub/http.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698