__construct()
__construct()
Constructor does nothing
Implementation of a Compressor using GZIP/GUNZIP as the filter.
More details on these algorithms can be found at http://en.wikipedia.org/wiki/Gzip
compressInt(integer $my_int) : string
Used to compress an int as a fixed length string in the format of the compression algorithm underlying the compressor. For gzip we use RFC 1952 http://www.gzip.org/zlib/rfc-gzip.html and we store the int over the modified timestamp in the header of a compressed empty string. Hence, this will always be of fixed length 20.
integer | $my_int | the integer to compress as a fixed length string |
the fixed length string containing the packed int
uncompressInt(string $my_compressed_int) : integer
Used to uncompress an int from a fixed length string in the format of the compression algorithm underlying the compressor. For gzip we use RFC 1952 http://www.gzip.org/zlib/rfc-gzip.html and we store the int over the modified timestamp in the header of a compressed empty string. This has length 4 bytes starting at byte 4 of the gzip header.
string | $my_compressed_int | the fixed length string containing the packed int to extract |
the integer contained in that string
compressedIntLen() : integer
Computes the length of an int when packed using the underlying compression algorithm as a fixed length string. For gzip we use RFC 1952 http://www.gzip.org/zlib/rfc-gzip.html and we store the int over the modified timestamp in the header of a compressed empty string. Hence, this will always be of fixed length 20.
length of int as a fixed length compressed string