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