using System; using System.Text; namespace ICSharpCode.SharpZipLib.GZip { /// /// This class contains constants used for gzip. /// [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1707:Identifiers should not contain underscores", Justification = "kept for backwards compatibility")] sealed public class GZipConstants { /// /// First GZip identification byte /// public const byte ID1 = 0x1F; /// /// Second GZip identification byte /// public const byte ID2 = 0x8B; /// /// Deflate compression method /// public const byte CompressionMethodDeflate = 0x8; /// /// Get the GZip specified encoding (CP-1252 if supported, otherwise ASCII) /// public static Encoding Encoding { get { try { return Encoding.GetEncoding(1252); } catch { return Encoding.ASCII; } } } } /// /// GZip header flags /// [Flags] public enum GZipFlags: byte { /// /// Text flag hinting that the file is in ASCII /// FTEXT = 0x1 << 0, /// /// CRC flag indicating that a CRC16 preceeds the data /// FHCRC = 0x1 << 1, /// /// Extra flag indicating that extra fields are present /// FEXTRA = 0x1 << 2, /// /// Filename flag indicating that the original filename is present /// FNAME = 0x1 << 3, /// /// Flag bit mask indicating that a comment is present /// FCOMMENT = 0x1 << 4, } }