Patent attributes
A method for compressing a data stream based on a 3 byte sequence is used. Each three byte sequence is assigned a code word including a location and a length of the data associated with the code word. When a 6 byte sequence is located, a binary tree of 6 byte sequences sharing the same first three bytes is built, associating each 6 byte sequence with a position in the stream where the 6 byte sequence is found. When the length of a code word is changed, a byte sequence is emitted that identifies the code word to be changed and updating the length of the code word, so that when a match is found, a byte sequence is emitted that identifies the code word associated with the matched data. The method finds particular application in data streams that are sent to printers, and which contain large blocks of identical data.