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

Unified Diff: runtime/bin/socket_patch.dart

Issue 12504006: Make IOSink implement StringSink (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Correct rebase 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: runtime/bin/socket_patch.dart
diff --git a/runtime/bin/socket_patch.dart b/runtime/bin/socket_patch.dart
index 3b9aaae6882d2cd05a4c2718b03724b643815fa2..499bb4d54c6147225f2d97bcc87e1b2a0330198d 100644
--- a/runtime/bin/socket_patch.dart
+++ b/runtime/bin/socket_patch.dart
@@ -733,7 +733,7 @@ class _Socket extends Stream<List<int>> implements Socket {
onSubscriptionStateChange: _onSubscriptionStateChange,
onPauseStateChange: _onPauseStateChange);
_consumer = new _SocketStreamConsumer(this);
- _sink = new IOSink(_consumer);
+ _sink = new IOSink(_consumer, Encoding.ASCII);
// Disable read events until there is a subscription.
_raw.readEventsEnabled = false;
@@ -763,6 +763,16 @@ class _Socket extends Stream<List<int>> implements Socket {
unsubscribeOnError: unsubscribeOnError);
}
+ Encoding get encoding => _sink.encoding;
+ void set encoding(Encoding value) => _sink.encoding = value;
+
+ void write(Object obj) => _sink.write(obj);
+ void writeln(Object obj) => _sink.writeln(obj);
+ void writeCharCode(int charCode) => _sink.writeCharCode(charCode);
+ void writeAll(Iterable objects) => _sink.writeAll(objects);
+
Mads Ager (google) 2013/03/07 07:57:36 Nit: remove the empty line or consistently have on
Søren Gjesse 2013/03/07 16:28:47 Done.
+ void writeBytes(List<int> bytes) => _sink.writeBytes(bytes);
+
Future<Socket> consume(Stream<List<int>> stream) {
return _sink.consume(stream);
}

Powered by Google App Engine
This is Rietveld 408576698