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

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

Issue 8493002: Change the default for the len argument to writeFrom on OutputStream (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed review comments from ager@ Created 9 years, 1 month 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 | « no previous file | runtime/bin/output_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 = new File(file.name); 7 _file = new File(file.name);
8 _file.openSync(); 8 _file.openSync();
9 } 9 }
10 10
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 File _file; 66 File _file;
67 } 67 }
68 68
69 69
70 class _FileOutputStream implements FileOutputStream { 70 class _FileOutputStream implements FileOutputStream {
71 _FileOutputStream(File file) { 71 _FileOutputStream(File file) {
72 _file = new File(file.name); 72 _file = new File(file.name);
73 _file.openSync(true); 73 _file.openSync(true);
74 } 74 }
75 75
76 bool write(List<int> buffer) { 76 bool write(List<int> buffer, [bool copyBuffer = false]) {
77 return _write(buffer, 0, buffer.length); 77 return _write(buffer, 0, buffer.length);
78 } 78 }
79 79
80 bool writeFrom(List<int> buffer, [int offset, int len]) { 80 bool writeFrom(List<int> buffer, [int offset, int len]) {
81 return _write(buffer, offset, (len == null) ? buffer.length : len); 81 return _write(
82 buffer, offset, (len == null) ? buffer.length - offset : len);
82 } 83 }
83 84
84 void end() { 85 void end() {
85 _file.closeSync(); 86 _file.closeSync();
86 } 87 }
87 88
88 void close() { 89 void close() {
89 _file.closeSync(); 90 _file.closeSync();
90 } 91 }
91 92
(...skipping 758 matching lines...) Expand 10 before | Expand all | Expand 10 after
850 var _closeHandler; 851 var _closeHandler;
851 var _readByteHandler; 852 var _readByteHandler;
852 var _readListHandler; 853 var _readListHandler;
853 var _noPendingWriteHandler; 854 var _noPendingWriteHandler;
854 var _positionHandler; 855 var _positionHandler;
855 var _lengthHandler; 856 var _lengthHandler;
856 var _flushHandler; 857 var _flushHandler;
857 var _fullPathHandler; 858 var _fullPathHandler;
858 var _errorHandler; 859 var _errorHandler;
859 } 860 }
OLDNEW
« no previous file with comments | « no previous file | runtime/bin/output_stream.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698