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. |
11 */ | 11 */ |
12 abstract class ZLibOption { | 12 abstract class ZLibOption { |
13 /// Minimal value for [ZLibCodec.windowBits], [ZLibEncoder.windowBits] | 13 /// Minimal value for [ZLibCodec.windowBits], [ZLibEncoder.windowBits] |
14 /// and [ZLibDecoder.windowBits]. | 14 /// and [ZLibDecoder.windowBits]. |
15 static const int MIN_WINDOW_BITS = 8; | 15 static const int MIN_WINDOW_BITS = 8; |
16 | 16 |
17 /// Maximal value for [ZLibCodec.windowBits], [ZLibEncoder.windowBits] | 17 /// Maximal value for [ZLibCodec.windowBits], [ZLibEncoder.windowBits] |
18 /// and [ZLibDecoder.windowBits]. | 18 /// and [ZLibDecoder.windowBits]. |
19 static const int MAX_WINDOW_BITS = 15; | 19 static const int MAX_WINDOW_BITS = 15; |
20 | 20 |
21 /// Default value for [ZLibCodec.windowBits], [ZLibEncoder.windowBits] | 21 /// Default value for [ZLibCodec.windowBits], [ZLibEncoder.windowBits] |
22 /// and [ZLibDecoder.windowBits]. | 22 /// and [ZLibDecoder.windowBits]. |
23 static const int DEFAULT_WINDOW_BITS = 15; | 23 static const int DEFAULT_WINDOW_BITS = 15; |
24 | 24 |
25 /// Minimal value for [ZLibCodec.level], [ZLibEncoder.level] | 25 /// Minimal value for [ZLibCodec.level] and [ZLibEncoder.level]. |
26 /// and [ZLibDecoder.level]. | |
27 static const int MIN_LEVEL = -1; | 26 static const int MIN_LEVEL = -1; |
28 | 27 |
29 /// Maximal value for [ZLibCodec.level], [ZLibEncoder.level] | 28 /// Maximal value for [ZLibCodec.level] and [ZLibEncoder.level] |
30 /// and [ZLibDecoder.level]. | |
31 static const int MAX_LEVEL = 9; | 29 static const int MAX_LEVEL = 9; |
32 | 30 |
33 /// Default value for [ZLibCodec.level], [ZLibEncoder.level] | 31 /// Default value for [ZLibCodec.level] and [ZLibEncoder.level]. |
34 /// and [ZLibDecoder.level]. | |
35 static const int DEFAULT_LEVEL = 6; | 32 static const int DEFAULT_LEVEL = 6; |
36 | 33 |
37 /// Minimal value for [ZLibCodec.memLevel], [ZLibEncoder.memLevel] | 34 /// Minimal value for [ZLibCodec.memLevel] and [ZLibEncoder.memLevel]. |
38 /// and [ZLibDecoder.memLevel]. | |
39 static const int MIN_MEM_LEVEL = 1; | 35 static const int MIN_MEM_LEVEL = 1; |
40 | 36 |
41 /// Maximal value for [ZLibCodec.memLevel], [ZLibEncoder.memLevel] | 37 /// Maximal value for [ZLibCodec.memLevel] and [ZLibEncoder.memLevel]. |
42 /// and [ZLibDecoder.memLevel]. | |
43 static const int MAX_MEM_LEVEL = 9; | 38 static const int MAX_MEM_LEVEL = 9; |
44 | 39 |
45 /// Default value for [ZLibCodec.memLevel], [ZLibEncoder.memLevel] | 40 /// Default value for [ZLibCodec.memLevel] and [ZLibEncoder.memLevel]. |
46 /// and [ZLibDecoder.memLevel]. | |
47 static const int DEFAULT_MEM_LEVEL = 8; | 41 static const int DEFAULT_MEM_LEVEL = 8; |
48 | 42 |
49 /// Recommended strategy for data produced by a filter (or predictor) | 43 /// Recommended strategy for data produced by a filter (or predictor) |
50 static const int STRATEGY_FILTERED = 1; | 44 static const int STRATEGY_FILTERED = 1; |
51 | 45 |
52 /// Use this strategy to force Huffman encoding only (no string match) | 46 /// Use this strategy to force Huffman encoding only (no string match) |
53 static const int STRATEGY_HUFFMAN_ONLY = 2; | 47 static const int STRATEGY_HUFFMAN_ONLY = 2; |
54 | 48 |
55 /// Use this strategy to limit match distances to one (run-length encoding) | 49 /// Use this strategy to limit match distances to one (run-length encoding) |
56 static const int STRATEGY_RLE = 3; | 50 static const int STRATEGY_RLE = 3; |
(...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
609 ZLibOption.STRATEGY_FILTERED, | 603 ZLibOption.STRATEGY_FILTERED, |
610 ZLibOption.STRATEGY_HUFFMAN_ONLY, | 604 ZLibOption.STRATEGY_HUFFMAN_ONLY, |
611 ZLibOption.STRATEGY_RLE, | 605 ZLibOption.STRATEGY_RLE, |
612 ZLibOption.STRATEGY_FIXED, | 606 ZLibOption.STRATEGY_FIXED, |
613 ZLibOption.STRATEGY_DEFAULT | 607 ZLibOption.STRATEGY_DEFAULT |
614 ]; | 608 ]; |
615 if (strategies.indexOf(strategy) == -1) { | 609 if (strategies.indexOf(strategy) == -1) { |
616 throw new ArgumentError("Unsupported 'strategy'"); | 610 throw new ArgumentError("Unsupported 'strategy'"); |
617 } | 611 } |
618 } | 612 } |
OLD | NEW |