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

Unified Diff: sdk/lib/io/file.dart

Issue 12504006: Make IOSink implement StringSink (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed second round of review comments 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/dart2js.dart ('k') | sdk/lib/io/file_impl.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/io/file.dart
diff --git a/sdk/lib/io/file.dart b/sdk/lib/io/file.dart
index 383cd5b2ebc8a2287fccbbabf42f9b0005e41509..1bfcb6cc42022f203a06db3c71036ef5a321d106 100644
--- a/sdk/lib/io/file.dart
+++ b/sdk/lib/io/file.dart
@@ -1,4 +1,4 @@
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@@ -174,8 +174,14 @@ abstract class File extends FileSystemEntity {
* * [FileMode.WRITE]: truncates the file to length zero.
* * [FileMode.APPEND]: sets the initial write position to the end
* of the file.
+ *
+ * When writing strings through the returned [IOSink] the encoding
+ * specified using [encoding] will be used. The returned [IOSink]
+ * has an [:encoding:] property which can be changed after the
+ * [IOSink] has been created.
*/
- IOSink<File> openWrite([FileMode mode = FileMode.WRITE]);
+ IOSink<File> openWrite({FileMode mode: FileMode.WRITE,
+ Encoding encoding: Encoding.UTF_8});
/**
* Read the entire file contents as a list of bytes. Returns a
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/dart2js.dart ('k') | sdk/lib/io/file_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698