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); |
}); |