| OLD | NEW |
| 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.convert; | 5 part of dart.convert; |
| 6 | 6 |
| 7 /** The Unicode Replacement character `U+FFFD` (�). */ | 7 /** The Unicode Replacement character `U+FFFD` (�). */ |
| 8 const int UNICODE_REPLACEMENT_CHARACTER_RUNE = 0xFFFD; | 8 const int UNICODE_REPLACEMENT_CHARACTER_RUNE = 0xFFFD; |
| 9 | 9 |
| 10 /** The Unicode Byte Order Marker (BOM) character `U+FEFF`. */ | 10 /** The Unicode Byte Order Marker (BOM) character `U+FEFF`. */ |
| (...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 353 stringSink = sink; | 353 stringSink = sink; |
| 354 } else { | 354 } else { |
| 355 stringSink = new StringConversionSink.from(sink); | 355 stringSink = new StringConversionSink.from(sink); |
| 356 } | 356 } |
| 357 return stringSink.asUtf8Sink(_allowMalformed); | 357 return stringSink.asUtf8Sink(_allowMalformed); |
| 358 } | 358 } |
| 359 | 359 |
| 360 // Override the base-classes bind, to provide a better type. | 360 // Override the base-classes bind, to provide a better type. |
| 361 Stream<String> bind(Stream<List<int>> stream) => super.bind(stream); | 361 Stream<String> bind(Stream<List<int>> stream) => super.bind(stream); |
| 362 | 362 |
| 363 @patch | |
| 364 Converter<List<int>,dynamic> fuse(Converter<String, dynamic> next) { | 363 Converter<List<int>,dynamic> fuse(Converter<String, dynamic> next) { |
| 365 return super.fuse(next); | 364 return super.fuse(next); |
| 366 } | 365 } |
| 367 } | 366 } |
| 368 | 367 |
| 369 // UTF-8 constants. | 368 // UTF-8 constants. |
| 370 const int _ONE_BYTE_LIMIT = 0x7f; // 7 bits | 369 const int _ONE_BYTE_LIMIT = 0x7f; // 7 bits |
| 371 const int _TWO_BYTE_LIMIT = 0x7ff; // 11 bits | 370 const int _TWO_BYTE_LIMIT = 0x7ff; // 11 bits |
| 372 const int _THREE_BYTE_LIMIT = 0xffff; // 16 bits | 371 const int _THREE_BYTE_LIMIT = 0xffff; // 16 bits |
| 373 const int _FOUR_BYTE_LIMIT = 0x10ffff; // 21 bits, truncated to Unicode max. | 372 const int _FOUR_BYTE_LIMIT = 0x10ffff; // 21 bits, truncated to Unicode max. |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 558 } | 557 } |
| 559 break loop; | 558 break loop; |
| 560 } | 559 } |
| 561 if (expectedUnits > 0) { | 560 if (expectedUnits > 0) { |
| 562 _value = value; | 561 _value = value; |
| 563 _expectedUnits = expectedUnits; | 562 _expectedUnits = expectedUnits; |
| 564 _extraUnits = extraUnits; | 563 _extraUnits = extraUnits; |
| 565 } | 564 } |
| 566 } | 565 } |
| 567 } | 566 } |
| OLD | NEW |