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

Unified Diff: runtime/bin/socket_stream_impl.dart

Issue 9235067: Use ByteArray's native for Socket and File. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 8 years, 11 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_stream_impl.dart
===================================================================
--- runtime/bin/socket_stream_impl.dart (revision 3811)
+++ runtime/bin/socket_stream_impl.dart (working copy)
@@ -17,11 +17,11 @@
bytesToRead = len;
}
}
- List<int> buffer = new List<int>(bytesToRead);
+ ByteArray buffer = new ByteArray(bytesToRead);
int bytesRead = _socket.readList(buffer, 0, bytesToRead);
if (bytesRead < bytesToRead) {
- List<int> newBuffer = new List<int>(bytesRead);
- newBuffer.copyFrom(buffer, 0, 0, bytesRead);
+ ByteArray newBuffer = new ByteArray(bytesRead);
+ newBuffer.setRange(0, bytesRead, buffer);
return newBuffer;
} else {
return buffer;

Powered by Google App Engine
This is Rietveld 408576698