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

Unified Diff: sdk/lib/io/buffer_list.dart

Issue 13453002: Read files in chunks, not relaying on size. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 9 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 | sdk/lib/io/file_impl.dart » ('j') | tests/standalone/io/file_read_special_device_test.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/io/buffer_list.dart
diff --git a/sdk/lib/io/buffer_list.dart b/sdk/lib/io/buffer_list.dart
index 0b3716c7a033c8de2a8a3a0f8f4dffb707d7d1a3..25a4fdd6102ffadf8d692f70e6fc6daf9f788f31 100644
--- a/sdk/lib/io/buffer_list.dart
+++ b/sdk/lib/io/buffer_list.dart
@@ -69,7 +69,8 @@ class _BufferList {
List<int> readBytes([int count]) {
if (count == null) count = length;
List<int> result;
- if (_length == 0 || _length < count) return null;
+ if (_length == 0) return new Uint8List(0);
+ if (_length < count) return null;
if (_index == 0 && _buffers.first.length == count) {
result = _buffers.first;
_buffers.removeFirst();
« no previous file with comments | « no previous file | sdk/lib/io/file_impl.dart » ('j') | tests/standalone/io/file_read_special_device_test.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698