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

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

Issue 11090016: Change core lib, dart2js, and more for new optional parameters syntax (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 2 months 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
« no previous file with comments | « runtime/bin/directory_impl.dart ('k') | runtime/bin/http_impl.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 : _data = const [], 7 : _data = const [],
8 _position = 0, 8 _position = 0,
9 _filePosition = 0 { 9 _filePosition = 0 {
10 var file = new File(name); 10 var file = new File(name);
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 _activeFillBufferCall = false; 92 _activeFillBufferCall = false;
93 _reportError(e); 93 _reportError(e);
94 return true; 94 return true;
95 }); 95 });
96 } 96 }
97 97
98 int available() { 98 int available() {
99 return closed ? 0 : _data.length - _position; 99 return closed ? 0 : _data.length - _position;
100 } 100 }
101 101
102 void pipe(OutputStream output, [bool close = true]) { 102 void pipe(OutputStream output, {bool close: true}) {
103 _pipe(this, output, close: close); 103 _pipe(this, output, close: close);
104 } 104 }
105 105
106 void _finishRead() { 106 void _finishRead() {
107 if (_position == _data.length && !_streamMarkedClosed) { 107 if (_position == _data.length && !_streamMarkedClosed) {
108 _fillBuffer(); 108 _fillBuffer();
109 } else { 109 } else {
110 _checkScheduleCallbacks(); 110 _checkScheduleCallbacks();
111 } 111 }
112 } 112 }
(...skipping 973 matching lines...) Expand 10 before | Expand all | Expand 10 after
1086 new FileIOException("File closed '$_name'")); 1086 new FileIOException("File closed '$_name'"));
1087 }); 1087 });
1088 return completer.future; 1088 return completer.future;
1089 } 1089 }
1090 1090
1091 final String _name; 1091 final String _name;
1092 int _id; 1092 int _id;
1093 1093
1094 SendPort _fileService; 1094 SendPort _fileService;
1095 } 1095 }
OLDNEW
« no previous file with comments | « runtime/bin/directory_impl.dart ('k') | runtime/bin/http_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698