8 void Gzip::WritePrestreamHeader()
23 void Gzip::ProcessUncompressedData(
const byte *inString,
size_t length)
25 m_crc.
Update(inString, length);
26 m_totalLen += (word32)length;
29 void Gzip::WritePoststreamTail()
40 :
Inflator(attachment, repeat, propagation), m_length(0)
44 void Gunzip::ProcessPrestreamHeader()
52 if (m_inQueue.Get(buf, 2)!=2)
throw HeaderErr();
53 if (buf[0] != MAGIC1 || buf[1] != MAGIC2)
throw HeaderErr();
54 if (!m_inQueue.Skip(1))
throw HeaderErr();
55 if (!m_inQueue.Get(flags))
throw HeaderErr();
56 if (flags & (ENCRYPTED | CONTINUED))
throw HeaderErr();
57 if (m_inQueue.Skip(6)!=6)
throw HeaderErr();
59 if (flags & EXTRA_FIELDS)
63 if (m_inQueue.Skip(length)!=length)
throw HeaderErr();
77 void Gunzip::ProcessDecompressedData(
const byte *inString,
size_t length)
80 m_crc.
Update(inString, length);
81 m_length += (word32)length;
84 void Gunzip::ProcessPoststreamTail()
87 if (m_inQueue.Get(crc, 4) != 4)
95 if (lengthCheck != m_length)
Exception thrown when a CRC error occurs.
Exception thrown when a length error occurs.
byte order is little-endian
Gunzip(BufferedTransformation *attachment=NULL, bool repeat=false, int autoSignalPropagation=-1)
Construct a Gunzip decompressor.
GZIP compression and decompression (RFC 1952)
Exception thrown when the tail is too short.
BufferedTransformation * AttachedTransformation()
Retrieve attached transformation.
void Update(const byte *input, size_t length)
Updates a hash with additional input.
DEFLATE (RFC 1951) decompressor.
int GetDeflateLevel() const
Retrieves the deflation level.
Crypto++ library namespace.