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

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

Issue 8989019: Implement list based output stream and add pipe to list based input streams (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed review comments from ager@ 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
« no previous file with comments | « runtime/bin/builtin_sources.gypi ('k') | runtime/bin/input_stream.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) 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 class _FileInputStream implements FileInputStream { 5 class _FileInputStream implements FileInputStream {
6 _FileInputStream(File file) { 6 _FileInputStream(File file) {
7 _file = file.openSync(); 7 _file = file.openSync();
8 _length = _file.lengthSync(); 8 _length = _file.lengthSync();
9 _checkScheduleCallbacks(); 9 _checkScheduleCallbacks();
10 } 10 }
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 121
122 class _FileOutputStream implements FileOutputStream { 122 class _FileOutputStream implements FileOutputStream {
123 _FileOutputStream(File file) { 123 _FileOutputStream(File file) {
124 _file = file.openSync(true); 124 _file = file.openSync(true);
125 } 125 }
126 126
127 bool write(List<int> buffer, [bool copyBuffer = false]) { 127 bool write(List<int> buffer, [bool copyBuffer = false]) {
128 return _write(buffer, 0, buffer.length); 128 return _write(buffer, 0, buffer.length);
129 } 129 }
130 130
131 bool writeFrom(List<int> buffer, [int offset, int len]) { 131 bool writeFrom(List<int> buffer, [int offset = 0, int len]) {
132 return _write( 132 return _write(
133 buffer, offset, (len == null) ? buffer.length - offset : len); 133 buffer, offset, (len == null) ? buffer.length - offset : len);
134 } 134 }
135 135
136 void end() { 136 void end() {
137 _file.closeSync(); 137 _file.closeSync();
138 } 138 }
139 139
140 void close() { 140 void close() {
141 _file.closeSync(); 141 _file.closeSync();
(...skipping 981 matching lines...) Expand 10 before | Expand all | Expand 10 after
1123 var _readByteHandler; 1123 var _readByteHandler;
1124 var _readListHandler; 1124 var _readListHandler;
1125 var _noPendingWriteHandler; 1125 var _noPendingWriteHandler;
1126 var _positionHandler; 1126 var _positionHandler;
1127 var _setPositionHandler; 1127 var _setPositionHandler;
1128 var _truncateHandler; 1128 var _truncateHandler;
1129 var _lengthHandler; 1129 var _lengthHandler;
1130 var _flushHandler; 1130 var _flushHandler;
1131 var _errorHandler; 1131 var _errorHandler;
1132 } 1132 }
OLDNEW
« no previous file with comments | « runtime/bin/builtin_sources.gypi ('k') | runtime/bin/input_stream.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698