| 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 /** | 7 /** |
| 8 * A [Converter] converts data from one representation into another. | 8 * A [Converter] converts data from one representation into another. |
| 9 * | 9 * |
| 10 * *Converters are still experimental and are subject to change without notice.* | 10 * *Converters are still experimental and are subject to change without notice.* |
| 11 * | 11 * |
| 12 */ | 12 */ |
| 13 abstract class Converter<S, T> implements StreamTransformer { | 13 abstract class Converter<S, T> implements StreamTransformer { |
| 14 const Converter(); |
| 15 |
| 14 /** | 16 /** |
| 15 * Converts [input] and returns the result of the conversion. | 17 * Converts [input] and returns the result of the conversion. |
| 16 */ | 18 */ |
| 17 T convert(S input); | 19 T convert(S input); |
| 18 | 20 |
| 19 /** | 21 /** |
| 20 * Fuses `this` with [other]. | 22 * Fuses `this` with [other]. |
| 21 * | 23 * |
| 22 * Encoding with the resulting converter is equivalent to converting with | 24 * Encoding with the resulting converter is equivalent to converting with |
| 23 * `this` before converting with `other`. | 25 * `this` before converting with `other`. |
| (...skipping 26 matching lines...) Expand all Loading... |
| 50 final Converter _second; | 52 final Converter _second; |
| 51 | 53 |
| 52 _FusedConverter(this._first, this._second); | 54 _FusedConverter(this._first, this._second); |
| 53 | 55 |
| 54 T convert(S input) => _second.convert(_first.convert(input)); | 56 T convert(S input) => _second.convert(_first.convert(input)); |
| 55 | 57 |
| 56 ChunkedConversionSink startChunkedConversion(ChunkedConversionSink sink) { | 58 ChunkedConversionSink startChunkedConversion(ChunkedConversionSink sink) { |
| 57 return _first.startChunkedConversion(_second.startChunkedConversion(sink)); | 59 return _first.startChunkedConversion(_second.startChunkedConversion(sink)); |
| 58 } | 60 } |
| 59 } | 61 } |
| OLD | NEW |