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

Unified Diff: sdk/lib/convert/string_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/line_splitter.dart ('k') | sdk/lib/convert/utf.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/convert/string_conversion.dart
diff --git a/sdk/lib/convert/string_conversion.dart b/sdk/lib/convert/string_conversion.dart
index ce10ad4512758e95c29a1f2c907224be3764a2a1..47329923f4058d05781771894605804e330b079a 100644
--- a/sdk/lib/convert/string_conversion.dart
+++ b/sdk/lib/convert/string_conversion.dart
@@ -22,7 +22,7 @@ abstract class StringConversionSink
StringConversionSink();
factory StringConversionSink.withCallback(void callback(String accumulated))
= _StringCallbackSink;
- factory StringConversionSink.from(ChunkedConversionSink<String> sink)
+ factory StringConversionSink.from(Sink<String> sink)
= _StringAdapterSink;
/**
@@ -250,7 +250,7 @@ class _StringCallbackSink extends _StringSinkConversionSink {
* ChunkedConversionSink) are redirected to the `add` method.
*/
class _StringAdapterSink extends StringConversionSinkBase {
- final ChunkedConversionSink<String> _sink;
+ final Sink<String> _sink;
_StringAdapterSink(this._sink);
@@ -274,16 +274,15 @@ class _StringAdapterSink extends StringConversionSinkBase {
*/
class _Utf8StringSinkAdapter extends ByteConversionSink {
final _Utf8Decoder _decoder;
- final ChunkedConversionSink _chunkedSink;
+ final Sink _sink;
- _Utf8StringSinkAdapter(ChunkedConversionSink chunkedSink,
- StringSink sink, bool allowMalformed)
- : _chunkedSink = chunkedSink,
- _decoder = new _Utf8Decoder(sink, allowMalformed);
+ _Utf8StringSinkAdapter(this._sink,
+ StringSink stringSink, bool allowMalformed)
+ : _decoder = new _Utf8Decoder(stringSink, allowMalformed);
void close() {
_decoder.close();
- if(_chunkedSink != null) _chunkedSink.close();
+ if(_sink != null) _sink.close();
}
void add(List<int> chunk) {
« no previous file with comments | « sdk/lib/convert/line_splitter.dart ('k') | sdk/lib/convert/utf.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698