InflaterState.cs 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. // Licensed to the .NET Foundation under one or more agreements.
  2. // The .NET Foundation licenses this file to you under the MIT license.
  3. // See the LICENSE file in the project root for more information.
  4. namespace SharpCompress.Compressors.Deflate64
  5. {
  6. // Do not rearrange the enum values.
  7. internal enum InflaterState
  8. {
  9. ReadingHeader = 0, // Only applies to GZIP
  10. ReadingBFinal = 2, // About to read bfinal bit
  11. ReadingBType = 3, // About to read blockType bits
  12. ReadingNumLitCodes = 4, // About to read # literal codes
  13. ReadingNumDistCodes = 5, // About to read # dist codes
  14. ReadingNumCodeLengthCodes = 6, // About to read # code length codes
  15. ReadingCodeLengthCodes = 7, // In the middle of reading the code length codes
  16. ReadingTreeCodesBefore = 8, // In the middle of reading tree codes (loop top)
  17. ReadingTreeCodesAfter = 9, // In the middle of reading tree codes (extension; code > 15)
  18. DecodeTop = 10, // About to decode a literal (char/match) in a compressed block
  19. HaveInitialLength = 11, // Decoding a match, have the literal code (base length)
  20. HaveFullLength = 12, // Ditto, now have the full match length (incl. extra length bits)
  21. HaveDistCode = 13, // Ditto, now have the distance code also, need extra dist bits
  22. /* uncompressed blocks */
  23. UncompressedAligning = 15,
  24. UncompressedByte1 = 16,
  25. UncompressedByte2 = 17,
  26. UncompressedByte3 = 18,
  27. UncompressedByte4 = 19,
  28. DecodingUncompressed = 20,
  29. // These three apply only to GZIP
  30. StartReadingFooter = 21, // (Initialisation for reading footer)
  31. ReadingFooter = 22,
  32. VerifyingFooter = 23,
  33. Done = 24 // Finished
  34. }
  35. }