| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 part of dart.io; | 5 part of dart.io; |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * The modes in which a File can be opened. | 8 * The modes in which a File can be opened. |
| 9 */ | 9 */ |
| 10 class FileMode { | 10 class FileMode { |
| (...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 575 | 575 |
| 576 /** | 576 /** |
| 577 * Synchronously reads a maximum of [bytes] bytes from a file and | 577 * Synchronously reads a maximum of [bytes] bytes from a file and |
| 578 * returns the result in a list of bytes. | 578 * returns the result in a list of bytes. |
| 579 * | 579 * |
| 580 * Throws a [FileSystemException] if the operation fails. | 580 * Throws a [FileSystemException] if the operation fails. |
| 581 */ | 581 */ |
| 582 List<int> readSync(int bytes); | 582 List<int> readSync(int bytes); |
| 583 | 583 |
| 584 /** | 584 /** |
| 585 * Reads into an existing List<int> from the file. If [start] is present, the | 585 * Reads into an existing [List<int>] from the file. If [start] is present, |
| 586 * bytes will be filled into [buffer] from at index [start], otherwise index | 586 * the bytes will be filled into [buffer] from at index [start], otherwise |
| 587 * 0. If [end] is present, the [end] - [start] bytes will be read into | 587 * index 0. If [end] is present, the [end] - [start] bytes will be read into |
| 588 * [buffer], otherwise up to [buffer.length]. If [end] == [start] nothing | 588 * [buffer], otherwise up to [buffer.length]. If [end] == [start] nothing |
| 589 * happends. | 589 * happends. |
| 590 * | 590 * |
| 591 * Returns a [:Future<int>:] that completes with the number of bytes read. | 591 * Returns a [:Future<int>:] that completes with the number of bytes read. |
| 592 */ | 592 */ |
| 593 Future<int> readInto(List<int> buffer, [int start = 0, int end]); | 593 Future<int> readInto(List<int> buffer, [int start = 0, int end]); |
| 594 | 594 |
| 595 /** | 595 /** |
| 596 * Synchronously reads into an existing List<int> from the file. If [start] is | 596 * Synchronously reads into an existing [List<int>] from the file. If [start] |
| 597 * present, the bytes will be filled into [buffer] from at index [start], | 597 * is present, the bytes will be filled into [buffer] from at index [start], |
| 598 * otherwise index 0. If [end] is present, the [end] - [start] bytes will be | 598 * otherwise index 0. If [end] is present, the [end] - [start] bytes will be |
| 599 * read into [buffer], otherwise up to [buffer.length]. If [end] == [start] | 599 * read into [buffer], otherwise up to [buffer.length]. If [end] == [start] |
| 600 * nothing happends. | 600 * nothing happends. |
| 601 * | 601 * |
| 602 * Throws a [FileSystemException] if the operation fails. | 602 * Throws a [FileSystemException] if the operation fails. |
| 603 */ | 603 */ |
| 604 int readIntoSync(List<int> buffer, [int start = 0, int end]); | 604 int readIntoSync(List<int> buffer, [int start = 0, int end]); |
| 605 | 605 |
| 606 /** | 606 /** |
| 607 * Writes a single byte to the file. Returns a | 607 * Writes a single byte to the file. Returns a |
| (...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 890 sb.write(": $osError"); | 890 sb.write(": $osError"); |
| 891 if (path != null) { | 891 if (path != null) { |
| 892 sb.write(", path = '$path'"); | 892 sb.write(", path = '$path'"); |
| 893 } | 893 } |
| 894 } else if (path != null) { | 894 } else if (path != null) { |
| 895 sb.write(": $path"); | 895 sb.write(": $path"); |
| 896 } | 896 } |
| 897 return sb.toString(); | 897 return sb.toString(); |
| 898 } | 898 } |
| 899 } | 899 } |
| OLD | NEW |