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

Unified Diff: runtime/bin/filter.dart

Issue 11275035: Introduce (private) ZLibFilter to dart:io. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Move bufferlength out as a top level constant. Created 8 years, 2 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: runtime/bin/filter.dart
diff --git a/runtime/bin/filter.dart b/runtime/bin/filter.dart
new file mode 100644
index 0000000000000000000000000000000000000000..c42fa3e8a16de1ae1a66ee4ccc0a4ffaf947098f
--- /dev/null
+++ b/runtime/bin/filter.dart
@@ -0,0 +1,36 @@
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+
+abstract class _Filter {
+ /**
+ * Call to process a chunk of data. A call to [process] should only be made
+ * when [processed] returns [null].
+ */
+ void process(List<int> data);
+
+ /**
+ * 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.
+ */
+ List<int> processed([bool flush = true]);
Søren Gjesse 2012/10/25 11:01:44 Maybe named argument instead of positional.
+
+ /**
+ * Mark the filter as closed. Always call this method for any filter created
+ * to avoid leaking resources. [end] can be called at any time, but any
+ * successive calls to [process] or [processed] will fail.
+ */
+ void end();
+}
+
+class GZipDeflateFilter implements _Filter {
+ factory GZipDeflateFilter()
+ => new _GZipDeflateFilterImpl();
+}
+
+class ZLibInflateFilter implements _Filter {
+ factory ZLibInflateFilter() => new _ZLibInflateFilterImpl();
+}
+
« runtime/bin/filter.cc ('K') | « runtime/bin/filter.cc ('k') | runtime/bin/filter_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698