| Index: runtime/bin/file_impl.dart
|
| ===================================================================
|
| --- runtime/bin/file_impl.dart (revision 3621)
|
| +++ runtime/bin/file_impl.dart (working copy)
|
| @@ -19,10 +19,10 @@
|
| }
|
|
|
| List<int> _read(int bytesToRead) {
|
| - List<int> result = new List<int>(bytesToRead);
|
| + List<int> result = new ByteArray(bytesToRead);
|
| int bytesRead = _file.readListSync(result, 0, bytesToRead);
|
| if (bytesRead < bytesToRead) {
|
| - List<int> buffer = new List<int>(bytesRead);
|
| + List<int> buffer = new ByteArray(bytesRead);
|
| buffer.copyFrom(result, 0, 0, bytesRead);
|
| result = buffer;
|
| }
|
| @@ -175,7 +175,7 @@
|
| port.toSendPort());
|
| return;
|
| }
|
| - var buffer = new List(_bytes);
|
| + var buffer = new ByteArray(_bytes);
|
| var result =
|
| new _ReadListResult(_FileUtils.readList(_id, buffer, 0, _bytes),
|
| buffer);
|
| @@ -424,12 +424,14 @@
|
| // When using the Dart C API access to ObjectArray by index is
|
| // currently much faster. This function will make a copy of the
|
| // supplied List to an ObjectArray if it isn't already.
|
| - ObjectArray outBuffer;
|
| + List<int> outBuffer;
|
| int outOffset = offset;
|
| if (buffer is ObjectArray) {
|
| outBuffer = buffer;
|
| + } else if (buffer is ByteArray) {
|
| + outBuffer = buffer;
|
| } else {
|
| - outBuffer = new ObjectArray(bytes);
|
| + outBuffer = new ByteArray(bytes);
|
| outOffset = 0;
|
| int j = offset;
|
| for (int i = 0; i < bytes; i++) {
|
|
|