Documentation

Lzw
in package
implements FilterInterface

Class for handling LZW encoded data

Table of Contents

Interfaces

FilterInterface
Interface for filters

Properties

$andTable  : array<string|int, mixed>
$bitsToGet  : int
$bytePointer  : int
$data  : null|string
$dataLength  : int
$nextBits  : int
$nextData  : int
$sTable  : array<string|int, mixed>
$tIdx  : int

Methods

decode()  : string
Method to decode LZW compressed data.
addStringToTable()  : mixed
Add a new string to the string table.
getNextCode()  : int
Returns the next 9, 10, 11 or 12 bits.
initsTable()  : mixed
Initialize the string table.

Properties

$andTable

protected array<string|int, mixed> $andTable = [511, 1023, 2047, 4095]

$bitsToGet

protected int $bitsToGet = 9

$bytePointer

protected int $bytePointer

$data

protected null|string $data

$dataLength

protected int $dataLength = 0

$nextBits

protected int $nextBits = 0

$nextData

protected int $nextData = 0

$sTable

protected array<string|int, mixed> $sTable = []

$tIdx

protected int $tIdx

Methods

decode()

Method to decode LZW compressed data.

public decode(string $data) : string
Parameters
$data : string

The compressed data

Tags
throws
LzwException
Return values
string

The uncompressed data

addStringToTable()

Add a new string to the string table.

protected addStringToTable(string $oldString[, string $newString = '' ]) : mixed
Parameters
$oldString : string
$newString : string = ''

getNextCode()

Returns the next 9, 10, 11 or 12 bits.

protected getNextCode() : int
Return values
int

initsTable()

Initialize the string table.

protected initsTable() : mixed

        
On this page

Search results