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

Side by Side Diff: sdk/lib/io/string_transformer.dart

Issue 18496011: Clean up dart:io warnings/errors found by analyzer tests. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 5 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 | « sdk/lib/io/link.dart ('k') | tests/standalone/io/file_fuzz_test.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) 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 /** 7 /**
8 * String encodings. 8 * String encodings.
9 */ 9 */
10 class Encoding { 10 class Encoding {
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 .transform(new StringEncoder(encoding)) 254 .transform(new StringEncoder(encoding))
255 .listen((data) => bytes = data); 255 .listen((data) => bytes = data);
256 controller.add(string); 256 controller.add(string);
257 controller.close(); 257 controller.close();
258 assert(bytes != null); 258 assert(bytes != null);
259 return bytes; 259 return bytes;
260 } 260 }
261 261
262 262
263 class LineTransformer extends StreamEventTransformer<String, String> { 263 class LineTransformer extends StreamEventTransformer<String, String> {
264 const int _LF = 10; 264 static const int _LF = 10;
265 const int _CR = 13; 265 static const int _CR = 13;
266 266
267 StringBuffer _buffer = new StringBuffer(); 267 StringBuffer _buffer = new StringBuffer();
268 String _carry; 268 String _carry;
269 269
270 void _handle(String data, EventSink<String> sink, bool isClosing) { 270 void _handle(String data, EventSink<String> sink, bool isClosing) {
271 if (_carry != null) { 271 if (_carry != null) {
272 data = _carry + data; 272 data = _carry + data;
273 _carry = null; 273 _carry = null;
274 } 274 }
275 int startPos = 0; 275 int startPos = 0;
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 411
412 // Utility class for decoding Windows current code page data delivered 412 // Utility class for decoding Windows current code page data delivered
413 // as a stream of bytes. 413 // as a stream of bytes.
414 class _WindowsCodePageDecoder extends StreamEventTransformer<List<int>, String> { 414 class _WindowsCodePageDecoder extends StreamEventTransformer<List<int>, String> {
415 void handleData(List<int> data, EventSink<String> sink) { 415 void handleData(List<int> data, EventSink<String> sink) {
416 sink.add(_decodeBytes(data)); 416 sink.add(_decodeBytes(data));
417 } 417 }
418 418
419 external static String _decodeBytes(List<int> bytes); 419 external static String _decodeBytes(List<int> bytes);
420 } 420 }
OLDNEW
« no previous file with comments | « sdk/lib/io/link.dart ('k') | tests/standalone/io/file_fuzz_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698