An embodiment of a method for compressing data includes variable length
coding one or more values of control codes generated from dictionary
coding the data, wherein the control codes comprise literals and indices,
wherein each index comprises a length value and a pointer to previously
read in data. An embodiment of a system for losslessly compressing input
data includes a modeler operable to determine whether a set of input data
matches prior input data, an encoder operable to generate control codes
including one or more literal control codes and one or more index control
codes, wherein each index control code includes a pointer to a location
in the input data and a length value indicating a number of bytes to copy
from the location, and wherein the length value is variable length coded.