program CodecTest; USES {xCrt,} ComTypes, LZTests, LZTypes, LZBase, LZDic, LZCodec, LZFile; var Dic:tLZCodec; const cInitialBuf='abcdabce abcd abceabcabcabcd abcaabcdabce abceca '; type tBIndex=0..Pred(Length(cInitialBuf)); tB=array[tBIndex] of char; tPB=^tB; tBufIndex=0..(High(word)-100); tBuff=array[tBufIndex] of char; tPBuff=^tBuff; var nc:tBufferIndex; i,j:word; EncodedBuf,InitialBuf,DecodedBuf:tPBuff; eds,es,EncodedBufSize, EncodedSize,EncodedDataSize,DecodedDataSize,OutSize:tBufferIndex; ibI:tBufIndex; b:byte; eq:BOOLEAN; f:file; begin writeln; writeln('Program Test LZCodec start...'); writeln; Dic.Init(Dic.SizeInNodesMax); Randomize; New(InitialBuf); New(EncodedBuf); New(DecodedBuf); { заполняем буфера } for ibI:=Low(ibI) to High(ibI) do begin b:=random(High(b)); InitialBuf^[ibI]:=Chr(b); DecodedBuf^[ibI]:=#0; EncodedBuf^[ibI]:=#0; end; { обеспечиваем наличие повторяющихся фрагментов } tPB(InitialBuf)^:=cInitialBuf; for ibI:=Low(ibI) to (High(ibI) div (Length(cInitialBuf)+10)) do begin tPB(@InitialBuf^[ibI*(Length(cInitialBuf)+10)])^:=cInitialBuf; end; writeln('Кодируем: '); Dic.EncodeReset; EncodedBufSize:=60000; { кодирование буфера } Dic.Encode(InitialBuf^,60000 {SizeOf(InitialBuf^),} {Length(cInitialBuf)}, EncodedSize, EncodedBuf^,EncodedBufSize, EncodedDataSize); if EncodedDataSize