OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 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. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 part of dart.io; | 5 part of dart.io; |
6 | 6 |
7 | 7 |
8 /** | 8 /** |
9 * An instance of the default implementation of the [ZLibCodec]. | 9 * An instance of the default implementation of the [ZLibCodec]. |
10 */ | 10 */ |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 } | 258 } |
259 | 259 |
260 | 260 |
261 | 261 |
262 /** | 262 /** |
263 * Private helper-class to handle native filters. | 263 * Private helper-class to handle native filters. |
264 */ | 264 */ |
265 abstract class _Filter { | 265 abstract class _Filter { |
266 /** | 266 /** |
267 * Call to process a chunk of data. A call to [process] should only be made | 267 * Call to process a chunk of data. A call to [process] should only be made |
268 * when [processed] returns [null]. | 268 * when [processed] returns [:null:]. |
269 */ | 269 */ |
270 void process(List<int> data, int start, int end); | 270 void process(List<int> data, int start, int end); |
271 | 271 |
272 /** | 272 /** |
273 * Get a chunk of processed data. When there are no more data available, | 273 * Get a chunk of processed data. When there are no more data available, |
274 * [processed] will return [null]. Set [flush] to [false] for non-final | 274 * [processed] will return [:null:]. Set [flush] to [:false:] for non-final |
275 * calls to improve performance of some filters. | 275 * calls to improve performance of some filters. |
276 * | 276 * |
277 * The last call to [processed] should have [end] set to [true]. This will mak
e | 277 * The last call to [processed] should have [end] set to [:true:]. This will m
ake |
278 * sure a 'end' packet is written on the stream. | 278 * sure a 'end' packet is written on the stream. |
279 */ | 279 */ |
280 List<int> processed({bool flush: true, bool end: false}); | 280 List<int> processed({bool flush: true, bool end: false}); |
281 | 281 |
282 /** | 282 /** |
283 * Mark the filter as closed. Always call this method for any filter created | 283 * Mark the filter as closed. Always call this method for any filter created |
284 * to avoid leaking resources. [end] can be called at any time, but any | 284 * to avoid leaking resources. [end] can be called at any time, but any |
285 * successive calls to [process] or [processed] will fail. | 285 * successive calls to [process] or [processed] will fail. |
286 */ | 286 */ |
287 void end(); | 287 void end(); |
288 | 288 |
289 external static _Filter newZLibDeflateFilter(bool gzip, int level); | 289 external static _Filter newZLibDeflateFilter(bool gzip, int level); |
290 external static _Filter newZLibInflateFilter(); | 290 external static _Filter newZLibInflateFilter(); |
291 } | 291 } |
OLD | NEW |