类 LZ77Compressor
- java.lang.Object
-
- com.github.myibu.algorithm.compress.LZ77Compressor
-
- 所有已实现的接口:
Compressor,Debugable
public class LZ77Compressor extends java.lang.Object implements Compressor
LZ77 compress algorithm
-
-
构造器概要
构造器 构造器 说明 LZ77Compressor()
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 intcompress(byte[] in_data, int in_len, byte[] out_data)while look-ahead buffer is not empty go backwards in search buffer to find longest match of the look-ahead buffer if match found print: (offset from window boundary, length of match, next symbol in look ahead buffer); shift window by length+1; else print: (0, 0, first symbol in look-ahead buffer); shift window by 1; fi end whileintdecompress(byte[] in_data, int in_len, byte[] out_data)for each token (offset, length, symbol) if offset = 0 then print symbol; else go reverse in previous output by offset characters and copy character wise for length symbols; print symbol; fi nextvoidsetDebug(boolean isDebug)enable Debug or not, default should be not enabledvoidsetSL(int s, int l)
-
-
-
方法详细资料
-
compress
public int compress(byte[] in_data, int in_len, byte[] out_data)while look-ahead buffer is not empty go backwards in search buffer to find longest match of the look-ahead buffer if match found print: (offset from window boundary, length of match, next symbol in look ahead buffer); shift window by length+1; else print: (0, 0, first symbol in look-ahead buffer); shift window by 1; fi end while- 指定者:
compress在接口中Compressor- 参数:
in_data- inputin_len- length of inputout_data- output- 返回:
- offset in output
-
decompress
public int decompress(byte[] in_data, int in_len, byte[] out_data)for each token (offset, length, symbol) if offset = 0 then print symbol; else go reverse in previous output by offset characters and copy character wise for length symbols; print symbol; fi next- 指定者:
decompress在接口中Compressor- 参数:
in_data- inputin_len- length of inputout_data- output- 返回:
- offset in output
-
setDebug
public void setDebug(boolean isDebug)
从接口复制的说明:Debugableenable Debug or not, default should be not enabled
-
setSL
public void setSL(int s, int l)
-
-