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

Side by Side Diff: sdk/lib/io/file.dart

Issue 11308226: Add RandomAccessFile.read method and use it for file input stream. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/bin/file_patch.dart ('k') | sdk/lib/io/file_impl.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 5
6 /** 6 /**
7 * FileMode describes the modes in which a file can be opened. 7 * FileMode describes the modes in which a file can be opened.
8 */ 8 */
9 class FileMode { 9 class FileMode {
10 static const READ = const FileMode._internal(0); 10 static const READ = const FileMode._internal(0);
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 */ 297 */
298 Future<int> readByte(); 298 Future<int> readByte();
299 299
300 /** 300 /**
301 * Synchronously read a single byte from the file. If end of file 301 * Synchronously read a single byte from the file. If end of file
302 * has been reached -1 is returned. 302 * has been reached -1 is returned.
303 */ 303 */
304 int readByteSync(); 304 int readByteSync();
305 305
306 /** 306 /**
307 * Reads from a file and returns the result as a list of bytes.
308 */
309 Future<List<int>> read(int bytes);
310
311 /**
312 * Synchronously reads from a file and returns the result in a
313 * list of bytes.
314 */
315 List<int> readSync(int bytes);
316
317 /**
307 * Read a List<int> from the file. Returns a [:Future<int>:] that 318 * Read a List<int> from the file. Returns a [:Future<int>:] that
308 * completes with an indication of how much was read. 319 * completes with an indication of how much was read.
309 */ 320 */
310 Future<int> readList(List<int> buffer, int offset, int bytes); 321 Future<int> readList(List<int> buffer, int offset, int bytes);
311 322
312 /** 323 /**
313 * Synchronously read a List<int> from the file. Returns the number 324 * Synchronously read a List<int> from the file. Returns the number
314 * of bytes read. 325 * of bytes read.
315 */ 326 */
316 int readListSync(List<int> buffer, int offset, int bytes); 327 int readListSync(List<int> buffer, int offset, int bytes);
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 sb.add(" ($osError)"); 445 sb.add(" ($osError)");
435 } 446 }
436 } else if (osError != null) { 447 } else if (osError != null) {
437 sb.add(": osError"); 448 sb.add(": osError");
438 } 449 }
439 return sb.toString(); 450 return sb.toString();
440 } 451 }
441 final String message; 452 final String message;
442 final OSError osError; 453 final OSError osError;
443 } 454 }
OLDNEW
« no previous file with comments | « runtime/bin/file_patch.dart ('k') | sdk/lib/io/file_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698