| OLD | NEW |
| 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 class _FileInputStream extends _BaseDataInputStream implements InputStream { | 5 class _FileInputStream extends _BaseDataInputStream implements InputStream { |
| 6 _FileInputStream(String name) { | 6 _FileInputStream(String name) { |
| 7 _file = new File(name); | 7 _file = new File(name); |
| 8 _data = []; | 8 _data = []; |
| 9 _position = 0; | 9 _position = 0; |
| 10 _file.errorHandler = (String s) { | 10 _file.errorHandler = (String s) { |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 } | 88 } |
| 89 | 89 |
| 90 File _file; | 90 File _file; |
| 91 List<int> _data; | 91 List<int> _data; |
| 92 int _position; | 92 int _position; |
| 93 bool _closed = false; | 93 bool _closed = false; |
| 94 } | 94 } |
| 95 | 95 |
| 96 | 96 |
| 97 class _FileOutputStream implements OutputStream { | 97 class _FileOutputStream implements OutputStream { |
| 98 _FileOutputStream(String name, int mode) { | 98 _FileOutputStream(String name, FileMode mode) { |
| 99 _pendingOperations = new List<List<int>>(); | 99 _pendingOperations = new List<List<int>>(); |
| 100 var f = new File(name); | 100 var f = new File(name); |
| 101 f.open(mode); | 101 f.open(mode); |
| 102 f.openHandler = (openedFile) { | 102 f.openHandler = (openedFile) { |
| 103 _file = openedFile; | 103 _file = openedFile; |
| 104 _setupFileHandlers(); | 104 _setupFileHandlers(); |
| 105 _processPendingOperations(); | 105 _processPendingOperations(); |
| 106 }; | 106 }; |
| 107 f.errorHandler = (e) { | 107 f.errorHandler = (e) { |
| 108 if (_errorHandler != null) _errorHandler(); | 108 if (_errorHandler != null) _errorHandler(); |
| (...skipping 1090 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1199 Function _readByteHandler; | 1199 Function _readByteHandler; |
| 1200 Function _readListHandler; | 1200 Function _readListHandler; |
| 1201 Function _noPendingWriteHandler; | 1201 Function _noPendingWriteHandler; |
| 1202 Function _positionHandler; | 1202 Function _positionHandler; |
| 1203 Function _setPositionHandler; | 1203 Function _setPositionHandler; |
| 1204 Function _truncateHandler; | 1204 Function _truncateHandler; |
| 1205 Function _lengthHandler; | 1205 Function _lengthHandler; |
| 1206 Function _flushHandler; | 1206 Function _flushHandler; |
| 1207 Function _errorHandler; | 1207 Function _errorHandler; |
| 1208 } | 1208 } |
| OLD | NEW |