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 * Exposes ZLib options for input parameters. | 8 * Exposes ZLib options for input parameters. |
9 * | 9 * |
10 * See http://www.zlib.net/manual.html for more documentation. | 10 * See http://www.zlib.net/manual.html for more documentation. |
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 * Get a [ZLibDecoder] for decoding `GZip` compressed data. | 285 * Get a [ZLibDecoder] for decoding `GZip` compressed data. |
286 */ | 286 */ |
287 ZLibDecoder get decoder => | 287 ZLibDecoder get decoder => |
288 new ZLibDecoder(windowBits: windowBits, dictionary: dictionary, raw: raw); | 288 new ZLibDecoder(windowBits: windowBits, dictionary: dictionary, raw: raw); |
289 } | 289 } |
290 | 290 |
291 /** | 291 /** |
292 * The [ZLibEncoder] encoder is used by [ZLibCodec] and [GZipCodec] to compress | 292 * The [ZLibEncoder] encoder is used by [ZLibCodec] and [GZipCodec] to compress |
293 * data. | 293 * data. |
294 */ | 294 */ |
295 class ZLibEncoder extends Converter<List<int>, List<int>> | 295 class ZLibEncoder extends Converter<List<int>, List<int>> { |
296 implements ChunkedConverter<List<int>, List<int>, List<int>, List<int>> { | |
297 /** | 296 /** |
298 * When true, `GZip` frames will be added to the compressed data. | 297 * When true, `GZip` frames will be added to the compressed data. |
299 */ | 298 */ |
300 final bool gzip; | 299 final bool gzip; |
301 | 300 |
302 /** | 301 /** |
303 * The compression-[level] can be set in the range of `-1..9`, with `6` being | 302 * The compression-[level] can be set in the range of `-1..9`, with `6` being |
304 * the default compression level. Levels above `6` will have higher | 303 * the default compression level. Levels above `6` will have higher |
305 * compression rates at the cost of more CPU and memory usage. Levels below | 304 * compression rates at the cost of more CPU and memory usage. Levels below |
306 * `6` will use less CPU and memory at the cost of lower compression rates. | 305 * `6` will use less CPU and memory at the cost of lower compression rates. |
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
610 ZLibOption.STRATEGY_FILTERED, | 609 ZLibOption.STRATEGY_FILTERED, |
611 ZLibOption.STRATEGY_HUFFMAN_ONLY, | 610 ZLibOption.STRATEGY_HUFFMAN_ONLY, |
612 ZLibOption.STRATEGY_RLE, | 611 ZLibOption.STRATEGY_RLE, |
613 ZLibOption.STRATEGY_FIXED, | 612 ZLibOption.STRATEGY_FIXED, |
614 ZLibOption.STRATEGY_DEFAULT | 613 ZLibOption.STRATEGY_DEFAULT |
615 ]; | 614 ]; |
616 if (strategies.indexOf(strategy) == -1) { | 615 if (strategies.indexOf(strategy) == -1) { |
617 throw new ArgumentError("Unsupported 'strategy'"); | 616 throw new ArgumentError("Unsupported 'strategy'"); |
618 } | 617 } |
619 } | 618 } |
OLD | NEW |