Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ Decode()

bool System.IO.Compression.InflaterManaged.Decode ( )
inlineprivate

Definition at line 145 of file InflaterManaged.cs.

146 {
147 bool end_of_block = false;
148 bool flag = false;
149 if (Finished())
150 {
151 return true;
152 }
153 if (_state == InflaterState.ReadingBFinal)
154 {
156 {
157 return false;
158 }
160 _state = InflaterState.ReadingBType;
161 }
162 if (_state == InflaterState.ReadingBType)
163 {
165 {
166 _state = InflaterState.ReadingBType;
167 return false;
168 }
170 if (_blockType == BlockType.Dynamic)
171 {
172 _state = InflaterState.ReadingNumLitCodes;
173 }
174 else if (_blockType == BlockType.Static)
175 {
177 _distanceTree = HuffmanTree.StaticDistanceTree;
178 _state = InflaterState.DecodeTop;
179 }
180 else
181 {
182 if (_blockType != 0)
183 {
184 throw new InvalidDataException(System.SR.UnknownBlockType);
185 }
186 _state = InflaterState.UncompressedAligning;
187 }
188 }
189 if (_blockType == BlockType.Dynamic)
190 {
191 flag = ((_state >= InflaterState.DecodeTop) ? DecodeBlock(out end_of_block) : DecodeDynamicBlockHeader());
192 }
193 else if (_blockType == BlockType.Static)
194 {
195 flag = DecodeBlock(out end_of_block);
196 }
197 else
198 {
199 if (_blockType != 0)
200 {
201 throw new InvalidDataException(System.SR.UnknownBlockType);
202 }
203 flag = DecodeUncompressedBlock(out end_of_block);
204 }
205 if (end_of_block && _bfinal != 0)
206 {
207 _state = InflaterState.Done;
208 }
209 return flag;
210 }
static HuffmanTree StaticDistanceTree
static HuffmanTree StaticLiteralLengthTree
bool DecodeUncompressedBlock(out bool end_of_block)
bool DecodeBlock(out bool end_of_block_code_seen)
static string UnknownBlockType
Definition SR.cs:36
Definition SR.cs:7

References System.IO.Compression.InflaterManaged._bfinal, System.IO.Compression.InflaterManaged._blockType, System.IO.Compression.InflaterManaged._distanceTree, System.IO.Compression.InflaterManaged._input, System.IO.Compression.InflaterManaged._literalLengthTree, System.IO.Compression.InflaterManaged._state, System.IO.Compression.InflaterManaged.DecodeBlock(), System.IO.Compression.InflaterManaged.DecodeDynamicBlockHeader(), System.IO.Compression.InflaterManaged.DecodeUncompressedBlock(), System.IO.Compression.InputBuffer.EnsureBitsAvailable(), System.IO.Compression.InflaterManaged.Finished(), System.IO.Compression.InputBuffer.GetBits(), System.IO.Compression.HuffmanTree.StaticDistanceTree, System.IO.Compression.HuffmanTree.StaticLiteralLengthTree, and System.SR.UnknownBlockType.

Referenced by System.IO.Compression.InflaterManaged.Inflate().