Added hammock project to debug streaming issues
[pithos-ms-client] / trunk / hammock / src / net35 / ICSharpCode.SharpZipLib.Silverlight / Zip / Compression / DeflaterConstants.cs
1 // DeflaterConstants.cs
2 //
3 // Copyright (C) 2001 Mike Krueger
4 // Copyright (C) 2004 John Reilly
5 //
6 // This file was translated from java, it was part of the GNU Classpath
7 // Copyright (C) 2001 Free Software Foundation, Inc.
8 //
9 // This program is free software; you can redistribute it and/or
10 // modify it under the terms of the GNU General Public License
11 // as published by the Free Software Foundation; either version 2
12 // of the License, or (at your option) any later version.
13 //
14 // This program is distributed in the hope that it will be useful,
15 // but WITHOUT ANY WARRANTY; without even the implied warranty of
16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 // GNU General Public License for more details.
18 //
19 // You should have received a copy of the GNU General Public License
20 // along with this program; if not, write to the Free Software
21 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
22 //
23 // Linking this library statically or dynamically with other modules is
24 // making a combined work based on this library.  Thus, the terms and
25 // conditions of the GNU General Public License cover the whole
26 // combination.
27 // 
28 // As a special exception, the copyright holders of this library give you
29 // permission to link this library with independent modules to produce an
30 // executable, regardless of the license terms of these independent
31 // modules, and to copy and distribute the resulting executable under
32 // terms of your choice, provided that you also meet, for each linked
33 // independent module, the terms and conditions of the license of that
34 // module.  An independent module is a module which is not derived from
35 // or based on this library.  If you modify this library, you may extend
36 // this exception to your version of the library, but you are not
37 // obligated to do so.  If you do not wish to do so, delete this
38 // exception statement from your version.
39
40 using System;
41
42 namespace ICSharpCode.SharpZipLib.Silverlight.Zip.Compression
43 {
44     /// <summary>
45     /// This class contains constants used for deflation.
46     /// </summary>
47     public class DeflaterConstants 
48     {
49         /// <summary>
50         /// Set to true to enable debugging
51         /// </summary>
52         public const bool DEBUGGING = false;
53                 
54         /// <summary>
55         /// Written to Zip file to identify a stored block
56         /// </summary>
57         public const int STORED_BLOCK = 0;
58                 
59         /// <summary>
60         /// Identifies static tree in Zip file
61         /// </summary>
62         public const int STATIC_TREES = 1;
63                 
64         /// <summary>
65         /// Identifies dynamic tree in Zip file
66         /// </summary>
67         public const int DYN_TREES    = 2;
68                 
69         /// <summary>
70         /// Header flag indicating a preset dictionary for deflation
71         /// </summary>
72         public const int PRESET_DICT  = 0x20;
73                 
74         /// <summary>
75         /// Sets internal buffer sizes for Huffman encoding
76         /// </summary>
77         public const int DEFAULT_MEM_LEVEL = 8;
78
79         /// <summary>
80         /// Internal compression engine constant
81         /// </summary>          
82         public const int MAX_MATCH = 258;
83                 
84         /// <summary>
85         /// Internal compression engine constant
86         /// </summary>          
87         public const int MIN_MATCH = 3;
88                 
89         /// <summary>
90         /// Internal compression engine constant
91         /// </summary>          
92         public const int MAX_WBITS = 15;
93                 
94         /// <summary>
95         /// Internal compression engine constant
96         /// </summary>          
97         public const int WSIZE = 1 << MAX_WBITS;
98                 
99         /// <summary>
100         /// Internal compression engine constant
101         /// </summary>          
102         public const int WMASK = WSIZE - 1;
103                 
104         /// <summary>
105         /// Internal compression engine constant
106         /// </summary>          
107         public const int HASH_BITS = DEFAULT_MEM_LEVEL + 7;
108                 
109         /// <summary>
110         /// Internal compression engine constant
111         /// </summary>          
112         public const int HASH_SIZE = 1 << HASH_BITS;
113                 
114         /// <summary>
115         /// Internal compression engine constant
116         /// </summary>          
117         public const int HASH_MASK = HASH_SIZE - 1;
118                 
119         /// <summary>
120         /// Internal compression engine constant
121         /// </summary>          
122         public const int HASH_SHIFT = (HASH_BITS + MIN_MATCH - 1) / MIN_MATCH;
123                 
124         /// <summary>
125         /// Internal compression engine constant
126         /// </summary>          
127         public const int MIN_LOOKAHEAD = MAX_MATCH + MIN_MATCH + 1;
128                 
129         /// <summary>
130         /// Internal compression engine constant
131         /// </summary>          
132         public const int MAX_DIST = WSIZE - MIN_LOOKAHEAD;
133                 
134         /// <summary>
135         /// Internal compression engine constant
136         /// </summary>          
137         public const int PENDING_BUF_SIZE = 1 << (DEFAULT_MEM_LEVEL + 8);
138                 
139         /// <summary>
140         /// Internal compression engine constant
141         /// </summary>          
142         public static int MAX_BLOCK_SIZE = Math.Min(65535, PENDING_BUF_SIZE - 5);
143                 
144         /// <summary>
145         /// Internal compression engine constant
146         /// </summary>          
147         public const int DEFLATE_STORED = 0;
148                 
149         /// <summary>
150         /// Internal compression engine constant
151         /// </summary>          
152         public const int DEFLATE_FAST   = 1;
153                 
154         /// <summary>
155         /// Internal compression engine constant
156         /// </summary>          
157         public const int DEFLATE_SLOW   = 2;
158                 
159         /// <summary>
160         /// Internal compression engine constant
161         /// </summary>          
162         public static int[] GOOD_LENGTH = { 0, 4,  4,  4,  4,  8,   8,   8,   32,   32 };
163                 
164         /// <summary>
165         /// Internal compression engine constant
166         /// </summary>          
167         public static int[] MAX_LAZY    = { 0, 4,  5,  6,  4, 16,  16,  32,  128,  258 };
168                 
169         /// <summary>
170         /// Internal compression engine constant
171         /// </summary>          
172         public static int[] NICE_LENGTH = { 0, 8, 16, 32, 16, 32, 128, 128,  258,  258 };
173                 
174         /// <summary>
175         /// Internal compression engine constant
176         /// </summary>          
177         public static int[] MAX_CHAIN   = { 0, 4,  8, 32, 16, 32, 128, 256, 1024, 4096 };
178                 
179         /// <summary>
180         /// Internal compression engine constant
181         /// </summary>          
182         public static int[] COMPR_FUNC  = { 0, 1,  1,  1,  1,  2,   2,   2,    2,    2 };
183                 
184     }
185 }