A method for reducing the amount of memory used to store an original data in a processing system by reducing the occurrence of a literal prefix. The method is completed by comparing strings from the original data to valid elements in a dictionary. If a match is found, then a data code, which points to the valid dictionary element, is stored as compressed data in the memory. If a match is not found, then the entry is defined as a literal. Assuming the literal is defined, next determine if a dictionary element pointed to by the literal is valid and if so, then store a literal prefix into the compressed data in the memory. Finally, independent of whether the lateral points to a valid dictionary element, the literal itself is stored into the compressed data in the memory. To decompress the compressed data first an entry of the compressed data is retrieved from the memory. If the entry is a literal prefix, then output a next entry of the compressed data. In the alternative, if the entry points to an invalid dictionary element then output the entry because it is a literal. Finally, the only alternative remaining is that the entry points to a valid dictionary element. Thus the a code that must be decompressed before it can be output.
展开▼