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

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: Fixed accidental edit 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
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});
Anders Johnsen 2013/03/07 16:53:49 Thinking about this API change, I'm EXTREMELY exci
Søren Gjesse 2013/03/08 09:47:46 Thanks.
/**
* Read the entire file contents as a list of bytes. Returns a

Powered by Google App Engine
This is Rietveld 408576698