OLD | NEW |
1 part of dart.convert; | 1 part of dart.convert; |
2 abstract class Converter<S, T> implements StreamTransformer {const Converter(); | 2 abstract class Converter<S, T> implements StreamTransformer {const Converter(); |
3 T convert(S input); | 3 T convert(S input); |
4 Converter<S, dynamic> fuse(Converter<T, dynamic> other) { | 4 Converter<S, dynamic> fuse(Converter<T, dynamic> other) { |
5 return new _FusedConverter<S, T, dynamic>(this, other); | 5 return new _FusedConverter<S, T, dynamic>(this, other); |
6 } | 6 } |
7 ChunkedConversionSink startChunkedConversion(Sink sink) { | 7 ChunkedConversionSink startChunkedConversion(Sink sink) { |
8 throw new UnsupportedError("This converter does not support chunked conversion
s: $this"); | 8 throw new UnsupportedError("This converter does not support chunked conversion
s: $this"); |
9 } | 9 } |
10 Stream bind(Stream source) { | 10 Stream bind(Stream source) { |
11 return new Stream.eventTransformed(source, (EventSink sink) => new _ConverterS
treamEventSink(this, sink)); | 11 return new Stream.eventTransformed(source, (EventSink sink) => new _ConverterS
treamEventSink(this, sink)); |
12 } | 12 } |
13 } | 13 } |
14 class _FusedConverter<S, M, T> extends Converter<S, T> {final Converter _first; | 14 class _FusedConverter<S, M, T> extends Converter<S, T> {final Converter _first; |
15 final Converter _second; | 15 final Converter _second; |
16 _FusedConverter(this._first, this._second); | 16 _FusedConverter(this._first, this._second); |
17 T convert(S input) => ((__x4) => DEVC$RT.cast(__x4, dynamic, T, "CastGeneral",
"""line 58, column 25 of dart:convert/converter.dart: """, __x4 is T, false))(_s
econd.convert(_first.convert(input))); | 17 T convert(S input) => ((__x4) => DEVC$RT.cast(__x4, dynamic, T, "CompositeCast"
, """line 58, column 25 of dart:convert/converter.dart: """, __x4 is T, false))(
_second.convert(_first.convert(input))); |
18 ChunkedConversionSink startChunkedConversion(Sink sink) { | 18 ChunkedConversionSink startChunkedConversion(Sink sink) { |
19 return _first.startChunkedConversion(_second.startChunkedConversion(sink)); | 19 return _first.startChunkedConversion(_second.startChunkedConversion(sink)); |
20 } | 20 } |
21 } | 21 } |
OLD | NEW |