OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 interface FileInputStream extends InputStream factory _FileInputStream { | |
6 FileInputStream(File file); | |
7 } | |
8 | |
9 interface FileOutputStream extends OutputStream factory _FileOutputStream { | |
10 FileOutputStream(File file); | |
11 } | |
12 | |
13 interface File factory _File { | 5 interface File factory _File { |
14 // Open a file. | 6 // Open a file. |
15 File(String name, bool writable); | 7 File(String name, bool writable); |
16 | 8 |
17 // Close the file. | 9 // Close the file. |
18 void close(); | 10 void close(); |
19 | 11 |
20 // Synchronously read a single byte from the file. | 12 // Synchronously read a single byte from the file. |
21 // TODO(jrgfogh): Remove this call. | 13 // TODO(jrgfogh): Remove this call. |
22 int readByte(); | 14 int readByte(); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 | 53 |
62 class FileIOException implements Exception { | 54 class FileIOException implements Exception { |
63 const FileIOException([String this.message = ""]); | 55 const FileIOException([String this.message = ""]); |
64 String toString() => "FileIOException: $message"; | 56 String toString() => "FileIOException: $message"; |
65 | 57 |
66 /* | 58 /* |
67 * Contains the exception message. | 59 * Contains the exception message. |
68 */ | 60 */ |
69 final String message; | 61 final String message; |
70 } | 62 } |
OLD | NEW |