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

Unified Diff: sdk/lib/convert/chunked_conversion.dart

Issue 203603008: Introduce class Sink<T>. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 6 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sdk/lib/convert/byte_conversion.dart ('k') | sdk/lib/convert/converter.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/convert/chunked_conversion.dart
diff --git a/sdk/lib/convert/chunked_conversion.dart b/sdk/lib/convert/chunked_conversion.dart
index c0a5c65c462c40a52538ea0b192c5e599dbfc2a2..c9a874c56905f090b16d6aff070844544a6eaf5a 100644
--- a/sdk/lib/convert/chunked_conversion.dart
+++ b/sdk/lib/convert/chunked_conversion.dart
@@ -10,10 +10,14 @@ typedef void _ChunkedConversionCallback<T>(T accumulated);
* A [ChunkedConversionSink] is used to transmit data more efficiently between
* two converters during chunked conversions.
*
+ * The basic `ChunkedConversionSink` is just a [Sink], and converters should
+ * work with a plain `Sink`, but may work more efficiently with certain
+ * specialized types of `ChunkedConversionSink`.
+ *
* It is recommended that implementations of `ChunkedConversionSink` extends
* this class, to inherit any further methods that may be added to the class.
*/
-abstract class ChunkedConversionSink<T> {
+abstract class ChunkedConversionSink<T> implements Sink<T> {
ChunkedConversionSink();
factory ChunkedConversionSink.withCallback(
void callback(List<T> accumulated)) = _SimpleCallbackSink;
@@ -80,8 +84,7 @@ class _ConverterStreamEventSink<S, T> implements EventSink<S> {
_ConverterStreamEventSink(Converter converter, EventSink<T> sink)
: this._eventSink = sink,
- _chunkedSink =
- converter.startChunkedConversion(new _EventSinkAdapter(sink));
+ _chunkedSink = converter.startChunkedConversion(sink);
void add(S o) => _chunkedSink.add(o);
void addError(Object error, [StackTrace stackTrace]) {
« no previous file with comments | « sdk/lib/convert/byte_conversion.dart ('k') | sdk/lib/convert/converter.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698