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

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

Issue 18031023: Remove _BufferList from dart:io and now use BytesBuilder. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Use takeBytes not toBytes. Created 7 years, 5 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/websocket_impl.dart
diff --git a/sdk/lib/io/websocket_impl.dart b/sdk/lib/io/websocket_impl.dart
index d9030619b685c10cd8cf3f954e449fb2d7ab0231..33aec3f51f2fa1e8bd2c56a34e62d6f3b35c6016 100644
--- a/sdk/lib/io/websocket_impl.dart
+++ b/sdk/lib/io/websocket_impl.dart
@@ -111,9 +111,9 @@ class _WebSocketProtocolTransformer extends StreamEventTransformer {
_currentMessageType = _WebSocketMessageType.BINARY;
_controller = new StreamController(sync: true);
_controller.stream
- .fold(new _BufferList(), (buffer, data) => buffer..add(data))
+ .fold(new BytesBuilder(), (buffer, data) => buffer..add(data))
.then((buffer) {
- sink.add(buffer.readBytes());
+ sink.add(buffer.takeBytes());
}, onError: (error) {
sink.addError(error);
});

Powered by Google App Engine
This is Rietveld 408576698