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

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

Issue 15547003: Add 'start' and 'end' optional arguments to File.openRead(). This makes it possible to stream a sub… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 7 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_input_stream_test.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/io/file.dart
diff --git a/sdk/lib/io/file.dart b/sdk/lib/io/file.dart
index 20110af9ec064796cabd265f41b49323b484cf0d..306fe0fe918aac6104c286f1de764f5af2ffbc24 100644
--- a/sdk/lib/io/file.dart
+++ b/sdk/lib/io/file.dart
@@ -186,8 +186,14 @@ abstract class File extends FileSystemEntity {
* In order to make sure that system resources are freed, the stream
* must be read to completion or the subscription on the stream must
* be cancelled.
+ *
+ * If [start] is present, the file will be read from byte-offset [start].
Søren Gjesse 2013/05/21 09:06:04 add (index 0) after beginning.
Anders Johnsen 2013/05/21 09:22:11 Done.
+ * Otherwise from the beginning.
+ *
+ * If [end] is present, only up to byte-index [end] will be read. Otherwise,
+ * until end of file.
*/
- Stream<List<int>> openRead();
+ Stream<List<int>> openRead([int start, int end]);
/**
* Creates a new independent [IOSink] for the file. The
« no previous file with comments | « no previous file | sdk/lib/io/file_impl.dart » ('j') | tests/standalone/io/file_input_stream_test.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698