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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/tools/mini_parser.dart

Issue 14018007: Rename RandomAccessFile.readList and RandomAccessFile.writeList to RandomAccessFile.readInto and Ra… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merge Created 7 years, 8 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
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 library parser; 5 library parser;
6 6
7 import 'dart:io'; 7 import 'dart:io';
8 import 'dart:typeddata'; 8 import 'dart:typeddata';
9 import 'dart:collection'; 9 import 'dart:collection';
10 import 'dart:utf'; 10 import 'dart:utf';
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 }; 157 };
158 stringStream.onClosed = closeHandler; 158 stringStream.onClosed = closeHandler;
159 } 159 }
160 160
161 List<int> read(String filename) { 161 List<int> read(String filename) {
162 RandomAccessFile file = new File(filename).openSync(); 162 RandomAccessFile file = new File(filename).openSync();
163 bool threw = true; 163 bool threw = true;
164 try { 164 try {
165 int size = file.lengthSync(); 165 int size = file.lengthSync();
166 List<int> bytes = new Uint8List(size + 1); 166 List<int> bytes = new Uint8List(size + 1);
167 file.readListSync(bytes, 0, size); 167 file.readIntoSync(bytes, 0, size);
168 bytes[size] = $EOF; 168 bytes[size] = $EOF;
169 threw = false; 169 threw = false;
170 return bytes; 170 return bytes;
171 } finally { 171 } finally {
172 try { 172 try {
173 file.closeSync(); 173 file.closeSync();
174 } catch (ex) { 174 } catch (ex) {
175 if (!threw) throw; 175 if (!threw) throw;
176 } 176 }
177 } 177 }
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 set text(String newText) { 312 set text(String newText) {
313 throw "not supported"; 313 throw "not supported";
314 } 314 }
315 } 315 }
316 316
317 class Mock { 317 class Mock {
318 const Mock(); 318 const Mock();
319 bool get useColors => true; 319 bool get useColors => true;
320 internalError(message) { throw message.toString(); } 320 internalError(message) { throw message.toString(); }
321 } 321 }
OLDNEW
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/source_file_provider.dart ('k') | sdk/lib/io/common.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698