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 // Read the file in blocks of size 64k. | 7 // Read the file in blocks of size 64k. |
8 const int _BLOCK_SIZE = 64 * 1024; | 8 const int _BLOCK_SIZE = 64 * 1024; |
9 | 9 |
10 class _FileStream extends Stream<List<int>> { | 10 class _FileStream extends Stream<List<int>> { |
11 // Stream controller. | 11 // Stream controller. |
12 StreamController<List<int>> _controller; | 12 StreamController<List<int>> _controller; |
13 | 13 |
14 // Information about the underlying file. | 14 // Information about the underlying file. |
15 String _path; | 15 String _path; |
(...skipping 1048 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1064 void _checkAvailable() { | 1064 void _checkAvailable() { |
1065 if (_asyncDispatched) { | 1065 if (_asyncDispatched) { |
1066 throw new FileSystemException( | 1066 throw new FileSystemException( |
1067 "An async operation is currently pending", path); | 1067 "An async operation is currently pending", path); |
1068 } | 1068 } |
1069 if (closed) { | 1069 if (closed) { |
1070 throw new FileSystemException("File closed", path); | 1070 throw new FileSystemException("File closed", path); |
1071 } | 1071 } |
1072 } | 1072 } |
1073 } | 1073 } |
OLD | NEW |