GZipConstants.cs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. namespace System.Net.ApiService.Compression.GZip {
  2. /// <summary>
  3. /// This class contains constants used for gzip.
  4. /// </summary>
  5. sealed public class GZipConstants
  6. {
  7. /// <summary>
  8. /// Magic number found at start of GZIP header
  9. /// </summary>
  10. public const int GZIP_MAGIC = 0x1F8B;
  11. /* The flag byte is divided into individual bits as follows:
  12. bit 0 FTEXT
  13. bit 1 FHCRC
  14. bit 2 FEXTRA
  15. bit 3 FNAME
  16. bit 4 FCOMMENT
  17. bit 5 reserved
  18. bit 6 reserved
  19. bit 7 reserved
  20. */
  21. /// <summary>
  22. /// Flag bit mask for text
  23. /// </summary>
  24. public const int FTEXT = 0x1;
  25. /// <summary>
  26. /// Flag bitmask for Crc
  27. /// </summary>
  28. public const int FHCRC = 0x2;
  29. /// <summary>
  30. /// Flag bit mask for extra
  31. /// </summary>
  32. public const int FEXTRA = 0x4;
  33. /// <summary>
  34. /// flag bitmask for name
  35. /// </summary>
  36. public const int FNAME = 0x8;
  37. /// <summary>
  38. /// flag bit mask indicating comment is present
  39. /// </summary>
  40. public const int FCOMMENT = 0x10;
  41. /// <summary>
  42. /// Initialise default instance.
  43. /// </summary>
  44. /// <remarks>Constructor is private to prevent instances being created.</remarks>
  45. private GZipConstants()
  46. {
  47. }
  48. }
  49. }