\seekquarry\yioop\library\compressorsCompressor

A Compressor is used to apply a filter to objects before they are stored into a WebArchive. The filter is assumed to be invertible, and the typical intention is the filter carries out some kind of string compression.

Summary

Methods
Constants
compress()
uncompress()
compressInt()
uncompressInt()
compressedIntLen()
fileExtension()
No constants found
No protected methods found
N/A
No private methods found
N/A

Methods

compress()

compress(string  $str) : string

Applies the Compressor compress filter to a string before it is inserted into a WebArchive.

Parameters

string $str

string to apply filter to

Returns

string —

the result of applying the filter

uncompress()

uncompress(string  $str) : string

Used to unapply the compress filter as when data is read out of a WebArchive.

Parameters

string $str

data read from a string archive

Returns

string —

result of uncompressing

compressInt()

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.

Parameters

integer $my_int

the integer to compress as a fixed length string

Returns

string —

the fixed length string containing the packed int

uncompressInt()

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.

Parameters

string $my_compressed_int

the fixed length string containing the packed int to extract

Returns

integer —

the integer contained in that string

compressedIntLen()

compressedIntLen() : integer

Computes the length of an int when packed using the underlying compression algorithm as a fixed length string

Returns

integer —

length of int as a fixed length compressed string

fileExtension()

fileExtension() : string

File extension that should be associated with this compressor

Returns

string —

name of dos file extension