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

Side by Side Diff: runtime/bin/file.dart

Issue 9029001: Add close to input stream and cleanup socket and streams (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 9 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
OLDNEW
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 File default _File { 5 interface File default _File {
6 /** 6 /**
7 * Create a File object. 7 * Create a File object.
8 */ 8 */
9 File(String name); 9 File(String name);
10 10
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 /** 73 /**
74 * Synchronously get the canonical full path corresponding to the file name. 74 * Synchronously get the canonical full path corresponding to the file name.
75 */ 75 */
76 String fullPathSync(); 76 String fullPathSync();
77 77
78 /** 78 /**
79 * Create a new independent input stream for the file. The file 79 * Create a new independent input stream for the file. The file
80 * input stream must be closed when no longer used to free up 80 * input stream must be closed when no longer used to free up
81 * system resources. 81 * system resources.
82 */ 82 */
83 FileInputStream openInputStream(); 83 InputStream openInputStream();
84 84
85 /** 85 /**
86 * Creates a new independent output stream for the file. The file 86 * Creates a new independent output stream for the file. The file
87 * output stream must be closed when no longer used to free up 87 * output stream must be closed when no longer used to free up
88 * system resources. 88 * system resources.
89 */ 89 */
90 FileOutputStream openOutputStream(); 90 OutputStream openOutputStream();
91 91
92 /** 92 /**
93 * Get the name of the file. 93 * Get the name of the file.
94 */ 94 */
95 String get name(); 95 String get name();
96 96
97 // Event handlers. 97 // Event handlers.
98 void set existsHandler(void handler(bool exists)); 98 void set existsHandler(void handler(bool exists));
99 void set createHandler(void handler()); 99 void set createHandler(void handler());
100 void set deleteHandler(void handler()); 100 void set deleteHandler(void handler());
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 void set noPendingWriteHandler(void handler()); 247 void set noPendingWriteHandler(void handler());
248 void set positionHandler(void handler(int position)); 248 void set positionHandler(void handler(int position));
249 void set setPositionHandler(void handler()); 249 void set setPositionHandler(void handler());
250 void set truncateHandler(void handler()); 250 void set truncateHandler(void handler());
251 void set lengthHandler(void handler(int length)); 251 void set lengthHandler(void handler(int length));
252 void set flushHandler(void handler()); 252 void set flushHandler(void handler());
253 void set errorHandler(void handler(String error)); 253 void set errorHandler(void handler(String error));
254 } 254 }
255 255
256 256
257 interface FileInputStream extends InputStream {
258 void close();
259 }
260
261
262 interface FileOutputStream extends OutputStream {
263 }
264
265
266 class FileIOException implements Exception { 257 class FileIOException implements Exception {
267 const FileIOException([String this.message = ""]); 258 const FileIOException([String this.message = ""]);
268 String toString() => "FileIOException: $message"; 259 String toString() => "FileIOException: $message";
269 final String message; 260 final String message;
270 } 261 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698