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

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

Issue 14028017: Remove .writeStream, .consume and rewrite IOSink to correctly implement a (sane) well-defined behav… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Review comments. Created 7 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
« no previous file with comments | « sdk/lib/async/timer.dart ('k') | sdk/lib/io/file_impl.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 * FileMode describes the modes in which a file can be opened. 8 * FileMode describes the modes in which a file can be opened.
9 */ 9 */
10 class FileMode { 10 class FileMode {
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 * 198 *
199 * * [FileMode.WRITE]: truncates the file to length zero. 199 * * [FileMode.WRITE]: truncates the file to length zero.
200 * * [FileMode.APPEND]: sets the initial write position to the end 200 * * [FileMode.APPEND]: sets the initial write position to the end
201 * of the file. 201 * of the file.
202 * 202 *
203 * When writing strings through the returned [IOSink] the encoding 203 * When writing strings through the returned [IOSink] the encoding
204 * specified using [encoding] will be used. The returned [IOSink] 204 * specified using [encoding] will be used. The returned [IOSink]
205 * has an [:encoding:] property which can be changed after the 205 * has an [:encoding:] property which can be changed after the
206 * [IOSink] has been created. 206 * [IOSink] has been created.
207 */ 207 */
208 IOSink<File> openWrite({FileMode mode: FileMode.WRITE, 208 IOSink openWrite({FileMode mode: FileMode.WRITE,
209 Encoding encoding: Encoding.UTF_8}); 209 Encoding encoding: Encoding.UTF_8});
210 210
211 /** 211 /**
212 * Read the entire file contents as a list of bytes. Returns a 212 * Read the entire file contents as a list of bytes. Returns a
213 * [:Future<List<int>>:] that completes with the list of bytes that 213 * [:Future<List<int>>:] that completes with the list of bytes that
214 * is the contents of the file. 214 * is the contents of the file.
215 */ 215 */
216 Future<List<int>> readAsBytes(); 216 Future<List<int>> readAsBytes();
217 217
218 /** 218 /**
219 * Synchronously read the entire file contents as a list of bytes. 219 * Synchronously read the entire file contents as a list of bytes.
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
525 sb.write(" ($osError)"); 525 sb.write(" ($osError)");
526 } 526 }
527 } else if (osError != null) { 527 } else if (osError != null) {
528 sb.write(": osError"); 528 sb.write(": osError");
529 } 529 }
530 return sb.toString(); 530 return sb.toString();
531 } 531 }
532 final String message; 532 final String message;
533 final OSError osError; 533 final OSError osError;
534 } 534 }
OLDNEW
« no previous file with comments | « sdk/lib/async/timer.dart ('k') | sdk/lib/io/file_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698