6. The data compression method according to claim 1 , wherein in the candidate acquiring unit, as one or plural subsequent candidates following the first candidate, a stored value acquired from the recent match position list with a preceding candidate being taken as an address, and in the match detecting unit, each of character strings starting at the first candidate and the subsequent candidates and the character string starting at the coding position are compared, and a character string having the longest match length is acquired and coded.
1. A data compression method that generates compressed data from a data string to be compressed, comprising: inputting and retaining, by an input unit, the data string to be compressed in an input buffer; generating and retaining, by a recent match position list generating unit, a recent match position list having stored therein a relative position where each character string having a predetermined length starting at each address in the input buffer has most recently appeared; acquiring, by a repetition candidate acquiring unit, with the use of the recent match position list, a repetition candidate at a position where a character string at a coding position has previously appeared; comparing, by a match detecting unit, a character string starting at the position of the acquired repetition candidate and the character string at the coding position, and detecting a matching character string from the position of the repetition candidate; and coding, by a code generating unit, the detected matching character string having the longest match length, wherein in the candidate acquiring unit, a stored value acquired from the recent match position list with the coding position being taken as an address is taken as a first candidate for a character string repetition position, in the match detecting unit, a character string starting at a position of the first candidate and the character string starting at the coding position are compared, and a matching character string is acquired and coded, the candidate acquiring unit further includes: comparing, with the first candidate being taken as an evaluation value, a stored value acquired from the recent match position list and the evaluation value with each position subsequent to the coding position being taken as an address and, when the acquired store value is a value previous to the evaluation value, acquiring one or plural subsequent candidates following the first candidate in order of increasing distance from the coding position comparing each of character strings starting at the first candidate and the subsequent candidates and the character string starting at the coding position, and taking, as a revised first candidate a character string having the longest match length with respect to the character string at the coding position, and taking, as one or plural subsequent candidates following the revised first candidate, a stored value acquired from the recent match position list as revised subsequent candidates with a preceding candidate being taken as an address, and in the match detecting unit, each of character strings starting at the revised first candidate and the revised subsequent candidates and the character string starting at the coding position are compared, and a character string having the longest match length is detected and coded.