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

◆ DecodeUncompressedBlock()

bool System.IO.Compression.InflaterManaged.DecodeUncompressedBlock ( out bool end_of_block)
inlineprivate

Definition at line 212 of file InflaterManaged.cs.

213 {
214 end_of_block = false;
215 while (true)
216 {
217 switch (_state)
218 {
219 case InflaterState.UncompressedAligning:
221 _state = InflaterState.UncompressedByte1;
222 goto case InflaterState.UncompressedByte1;
223 case InflaterState.UncompressedByte1:
224 case InflaterState.UncompressedByte2:
225 case InflaterState.UncompressedByte3:
226 case InflaterState.UncompressedByte4:
227 {
228 int bits = _input.GetBits(8);
229 if (bits < 0)
230 {
231 return false;
232 }
233 _blockLengthBuffer[(int)(_state - 16)] = (byte)bits;
234 if (_state == InflaterState.UncompressedByte4)
235 {
237 int num2 = _blockLengthBuffer[2] + _blockLengthBuffer[3] * 256;
238 if ((ushort)_blockLength != (ushort)(~num2))
239 {
240 throw new InvalidDataException(System.SR.InvalidBlockLength);
241 }
242 }
243 break;
244 }
245 case InflaterState.DecodingUncompressed:
246 {
248 _blockLength -= num;
249 if (_blockLength == 0)
250 {
251 _state = InflaterState.ReadingBFinal;
252 end_of_block = true;
253 return true;
254 }
255 if (_output.FreeBytes == 0)
256 {
257 return true;
258 }
259 return false;
260 }
261 default:
262 throw new InvalidDataException(System.SR.UnknownState);
263 }
264 _state++;
265 }
266 }
int CopyFrom(InputBuffer input, int length)
static string UnknownState
Definition SR.cs:38
static string InvalidBlockLength
Definition SR.cs:24
Definition SR.cs:7

References System.IO.Compression.InflaterManaged._blockLength, System.IO.Compression.InflaterManaged._blockLengthBuffer, System.IO.Compression.InflaterManaged._input, System.IO.Compression.InflaterManaged._output, System.IO.Compression.InflaterManaged._state, System.IO.Compression.OutputWindow.CopyFrom(), System.IO.Compression.OutputWindow.FreeBytes, System.IO.Compression.InputBuffer.GetBits(), System.SR.InvalidBlockLength, System.IO.Compression.InputBuffer.SkipToByteBoundary(), and System.SR.UnknownState.

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