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

Unified Diff: runtime/bin/file_impl.dart

Issue 10544110: Fix file buffering code that uses RemoveRange on a fixed-length Uint8 array. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/file_impl.dart
diff --git a/runtime/bin/file_impl.dart b/runtime/bin/file_impl.dart
index bc83f38cb885d594b20f1d82d7d68257e00da57f..682c2ea3657138676fd31325b43ba5d0b5e320d4 100644
--- a/runtime/bin/file_impl.dart
+++ b/runtime/bin/file_impl.dart
@@ -72,7 +72,9 @@ class _FileInputStream extends _BaseDataInputStream implements InputStream {
future.then((read) {
_filePosition += read;
if (read != _data.length) {
- _data.removeRange(read, _data.length - read);
+ var oldData = _data;
Anders Johnsen 2012/06/12 13:42:33 What about _data = _data.getRange(0, read);
Bill Hesse 2012/06/12 13:47:45 I don't know if that would be a Uint8List. Since
Anders Johnsen 2012/06/12 13:51:24 .getRange() is a object of same type (see runtime/
+ _data = new Uint8List(read);
+ _data.fillRange(0, read, oldData, 0);
}
_position = 0;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698