| OLD | NEW |
| 1 part of dart.convert; | 1 part of dart.convert; |
| 2 const int UNICODE_REPLACEMENT_CHARACTER_RUNE = 0xFFFD; | 2 const int UNICODE_REPLACEMENT_CHARACTER_RUNE = 0xFFFD; |
| 3 const int UNICODE_BOM_CHARACTER_RUNE = 0xFEFF; | 3 const int UNICODE_BOM_CHARACTER_RUNE = 0xFEFF; |
| 4 const Utf8Codec UTF8 = const Utf8Codec(); | 4 const Utf8Codec UTF8 = const Utf8Codec(); |
| 5 class Utf8Codec extends Encoding {final bool _allowMalformed; | 5 class Utf8Codec extends Encoding {final bool _allowMalformed; |
| 6 const Utf8Codec({ | 6 const Utf8Codec({ |
| 7 bool allowMalformed : false} | 7 bool allowMalformed : false} |
| 8 ) : _allowMalformed = allowMalformed; | 8 ) : _allowMalformed = allowMalformed; |
| 9 String get name => "utf-8"; | 9 String get name => "utf-8"; |
| 10 String decode(List<int> codeUnits, { | 10 String decode(List<int> codeUnits, { |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 return encoder._buffer.sublist(0, encoder._bufferIndex); | 34 return encoder._buffer.sublist(0, encoder._bufferIndex); |
| 35 } | 35 } |
| 36 StringConversionSink startChunkedConversion(Sink<List<int>> sink) { | 36 StringConversionSink startChunkedConversion(Sink<List<int>> sink) { |
| 37 if (sink is! ByteConversionSink) { | 37 if (sink is! ByteConversionSink) { |
| 38 sink = new ByteConversionSink.from(sink); | 38 sink = new ByteConversionSink.from(sink); |
| 39 } | 39 } |
| 40 return new _Utf8EncoderSink(DEVC$RT.cast(sink, DEVC$RT.type((Sink<List<int>> _)
{ | 40 return new _Utf8EncoderSink(DEVC$RT.cast(sink, DEVC$RT.type((Sink<List<int>> _)
{ |
| 41 } | 41 } |
| 42 ), ByteConversionSink, "ImplicitCast", """line 125, column 33 of dart:convert/ut
f.dart: """, sink is ByteConversionSink, true)); | 42 ), ByteConversionSink, "ImplicitCast", """line 125, column 33 of dart:convert/ut
f.dart: """, sink is ByteConversionSink, true)); |
| 43 } | 43 } |
| 44 Stream<List<int>> bind(Stream<String> stream) => ((__x15) => DEVC$RT.cast(__x15
, DEVC$RT.type((DDC$async$.Stream<dynamic> _) { | 44 Stream<List<int>> bind(Stream<String> stream) => super.bind(stream); |
| 45 } | |
| 46 ), DEVC$RT.type((DDC$async$.Stream<List<int>> _) { | |
| 47 } | |
| 48 ), "CompositeCast", """line 129, column 52 of dart:convert/utf.dart: """, __x15
is DDC$async$.Stream<List<int>>, false))(super.bind(stream)); | |
| 49 } | 45 } |
| 50 class _Utf8Encoder {int _carry = 0; | 46 class _Utf8Encoder {int _carry = 0; |
| 51 int _bufferIndex = 0; | 47 int _bufferIndex = 0; |
| 52 final List<int> _buffer; | 48 final List<int> _buffer; |
| 53 static const _DEFAULT_BYTE_BUFFER_SIZE = 1024; | 49 static const _DEFAULT_BYTE_BUFFER_SIZE = 1024; |
| 54 _Utf8Encoder() : this.withBufferSize(_DEFAULT_BYTE_BUFFER_SIZE); | 50 _Utf8Encoder() : this.withBufferSize(_DEFAULT_BYTE_BUFFER_SIZE); |
| 55 _Utf8Encoder.withBufferSize(int bufferSize) : _buffer = _createBuffer(bufferSiz
e); | 51 _Utf8Encoder.withBufferSize(int bufferSize) : _buffer = _createBuffer(bufferSiz
e); |
| 56 static List<int> _createBuffer(int size) => new Uint8List(size); | 52 static List<int> _createBuffer(int size) => new Uint8List(size); |
| 57 bool _writeSurrogate(int leadingSurrogate, int nextCodeUnit) { | 53 bool _writeSurrogate(int leadingSurrogate, int nextCodeUnit) { |
| 58 if (_isTailSurrogate(nextCodeUnit)) { | 54 if (_isTailSurrogate(nextCodeUnit)) { |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 ByteConversionSink startChunkedConversion(Sink<String> sink) { | 159 ByteConversionSink startChunkedConversion(Sink<String> sink) { |
| 164 StringConversionSink stringSink; | 160 StringConversionSink stringSink; |
| 165 if (sink is StringConversionSink) { | 161 if (sink is StringConversionSink) { |
| 166 stringSink = sink; | 162 stringSink = sink; |
| 167 } | 163 } |
| 168 else { | 164 else { |
| 169 stringSink = new StringConversionSink.from(sink); | 165 stringSink = new StringConversionSink.from(sink); |
| 170 } | 166 } |
| 171 return stringSink.asUtf8Sink(_allowMalformed); | 167 return stringSink.asUtf8Sink(_allowMalformed); |
| 172 } | 168 } |
| 173 Stream<String> bind(Stream<List<int>> stream) => ((__x16) => DEVC$RT.cast(__x16
, DEVC$RT.type((DDC$async$.Stream<dynamic> _) { | 169 Stream<String> bind(Stream<List<int>> stream) => super.bind(stream); |
| 174 } | |
| 175 ), DEVC$RT.type((DDC$async$.Stream<String> _) { | |
| 176 } | |
| 177 ), "CompositeCast", """line 361, column 52 of dart:convert/utf.dart: """, __x16
is DDC$async$.Stream<String>, false))(super.bind(stream)); | |
| 178 external Converter<List<int>, dynamic> fuse(Converter<String, dynamic> next); | 170 external Converter<List<int>, dynamic> fuse(Converter<String, dynamic> next); |
| 179 } | 171 } |
| 180 const int _ONE_BYTE_LIMIT = 0x7f; | 172 const int _ONE_BYTE_LIMIT = 0x7f; |
| 181 const int _TWO_BYTE_LIMIT = 0x7ff; | 173 const int _TWO_BYTE_LIMIT = 0x7ff; |
| 182 const int _THREE_BYTE_LIMIT = 0xffff; | 174 const int _THREE_BYTE_LIMIT = 0xffff; |
| 183 const int _FOUR_BYTE_LIMIT = 0x10ffff; | 175 const int _FOUR_BYTE_LIMIT = 0x10ffff; |
| 184 const int _SURROGATE_MASK = 0xF800; | 176 const int _SURROGATE_MASK = 0xF800; |
| 185 const int _SURROGATE_TAG_MASK = 0xFC00; | 177 const int _SURROGATE_TAG_MASK = 0xFC00; |
| 186 const int _SURROGATE_VALUE_MASK = 0x3FF; | 178 const int _SURROGATE_VALUE_MASK = 0x3FF; |
| 187 const int _LEAD_SURROGATE_MIN = 0xD800; | 179 const int _LEAD_SURROGATE_MIN = 0xD800; |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 315 } | 307 } |
| 316 break loop; | 308 break loop; |
| 317 } | 309 } |
| 318 if (expectedUnits > 0) { | 310 if (expectedUnits > 0) { |
| 319 _value = value; | 311 _value = value; |
| 320 _expectedUnits = expectedUnits; | 312 _expectedUnits = expectedUnits; |
| 321 _extraUnits = extraUnits; | 313 _extraUnits = extraUnits; |
| 322 } | 314 } |
| 323 } | 315 } |
| 324 } | 316 } |
| OLD | NEW |