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

Unified Diff: sdk/lib/io/data_transformer.dart

Issue 14962006: Actually end a ZLib stream with a Z_FINISH marker. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 7 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
Index: sdk/lib/io/data_transformer.dart
diff --git a/sdk/lib/io/data_transformer.dart b/sdk/lib/io/data_transformer.dart
index 4a4001d3c26aa2d6e8b6888e521ab14682ada4bd..c7c53adc7938ef6a2558bd734441bd05f5679fa8 100644
--- a/sdk/lib/io/data_transformer.dart
+++ b/sdk/lib/io/data_transformer.dart
@@ -18,8 +18,11 @@ abstract class _Filter {
* Get a chunk of processed data. When there are no more data available,
* [processed] will return [null]. Set [flush] to [false] for non-final
* calls to improve performance of some filters.
+ *
+ * The last call to [processed] should have [end] set to [true]. This will make
+ * sure a 'end' packet is written on the stream.
*/
- List<int> processed({bool flush: true});
+ List<int> processed({bool flush: true, bool end: false});
/**
* Mark the filter as closed. Always call this method for any filter created
@@ -62,7 +65,7 @@ class _FilterTransformer extends StreamEventTransformer<List<int>, List<int>> {
if (_empty) _filter.process(const []);
try {
var out;
- while ((out = _filter.processed()) != null) {
+ while ((out = _filter.processed(end: true)) != null) {
sink.add(out);
}
} catch (e, s) {

Powered by Google App Engine
This is Rietveld 408576698