Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | |
| 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. | |
| 4 | |
| 5 | |
| 6 abstract class _Filter { | |
| 7 /** | |
| 8 * Call to process a chunk of data. A call to [process] should only be made | |
| 9 * when [processed] returns [null]. | |
| 10 */ | |
| 11 void process(List<int> data); | |
| 12 | |
| 13 /** | |
| 14 * Get a chunk of processed data. When there are no more data available, | |
| 15 * [processed] will return [null]. Set [flush] to [false] for non-final | |
| 16 * calls to improve performance of some filters. | |
| 17 */ | |
| 18 List<int> processed([bool flush = true]); | |
|
Søren Gjesse
2012/10/25 11:01:44
Maybe named argument instead of positional.
| |
| 19 | |
| 20 /** | |
| 21 * Mark the filter as closed. Always call this method for any filter created | |
| 22 * to avoid leaking resources. [end] can be called at any time, but any | |
| 23 * successive calls to [process] or [processed] will fail. | |
| 24 */ | |
| 25 void end(); | |
| 26 } | |
| 27 | |
| 28 class GZipDeflateFilter implements _Filter { | |
| 29 factory GZipDeflateFilter() | |
| 30 => new _GZipDeflateFilterImpl(); | |
| 31 } | |
| 32 | |
| 33 class ZLibInflateFilter implements _Filter { | |
| 34 factory ZLibInflateFilter() => new _ZLibInflateFilterImpl(); | |
| 35 } | |
| 36 | |
| OLD | NEW |