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

Unified Diff: pkg/http/lib/src/byte_stream.dart

Issue 22872012: Remove Encoding-enum from dart:io and add interface in dart:convert. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix typo. Created 7 years, 4 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 | « pkg/barback/test/utils.dart ('k') | pkg/http/lib/src/multipart_file.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/http/lib/src/byte_stream.dart
diff --git a/pkg/http/lib/src/byte_stream.dart b/pkg/http/lib/src/byte_stream.dart
index 20f78747f25d115a4690a156b1461bf51bc14ef0..c75654a28e9b656dc5877582904d289f472179ef 100644
--- a/pkg/http/lib/src/byte_stream.dart
+++ b/pkg/http/lib/src/byte_stream.dart
@@ -5,6 +5,7 @@
library byte_stream;
import 'dart:async';
+import 'dart:convert';
import 'dart:io';
import 'dart:typed_data';
@@ -30,10 +31,10 @@ class ByteStream extends StreamView<List<int>> {
}
/// Collect the data of this stream in a [String], decoded according to
- /// [encoding], which defaults to `Encoding.UTF_8`.
- Future<String> bytesToString([Encoding encoding=Encoding.UTF_8]) =>
- toBytes().then((bytes) => decodeString(bytes, encoding));
+ /// [encoding], which defaults to `UTF8`.
+ Future<String> bytesToString([Encoding encoding=UTF8]) =>
+ toBytes().then((bytes) => encoding.decode(bytes));
- Stream<String> toStringStream([Encoding encoding=Encoding.UTF_8]) =>
- transform(new StringDecoder(encoding));
+ Stream<String> toStringStream([Encoding encoding=UTF8]) =>
+ transform(encoding.decoder);
}
« no previous file with comments | « pkg/barback/test/utils.dart ('k') | pkg/http/lib/src/multipart_file.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698