打印本文 打印本文 关闭窗口 关闭窗口
数据压缩 -- 源码
作者:武汉SEO闵涛  文章来源:敏韬网  点击数4565  更新时间:2009/4/23 18:30:48  文章录入:mintao  责任编辑:mintao
sp;   InFile := InStr;
    OutFile := OutStr;
    CompSize := InFile.Size - InFile.Position;
    InFile.Read(OrigSize,4);
    Decode;
  finally
    FreeMemory;
  end;
end;

INITIALIZATION
  CLen := nil;
  CTable := nil;
  Right := nil;
  Left := nil;
  Buffer := nil;
  Heap := nil;
END.

{******************************** Test Program ********************************}
{
  The following simple program can be used for testing the LH5Unit.
  It compresses/expands files compatible with LHArc.
}
program Testlh5;

uses
  WinCRT,
  SysUtils,
  Classes,
  Lh5Unit;

var
  InStr, OutStr: TFileStream;

begin
  IF NOT (ParamCount IN [2..3]) THEN
    BEGIN
      Writeln(''''Usage :'''');
      Writeln(''''To compress infile into outfile : LH5 infile outfile'''');
      Writeln(''''To expand infile into outfile :   LH5 infile outfile E'''');
      HALT;
    END;
  InStr := TFileStream.Create(Paramstr(1),fmOpenRead);
  OutStr := TFileStream.Create(Paramstr(2),fmCreate);
  IF ParamCount=2 THEN
      LHACompress(InStr, OutStr)
    ELSE
      LHAExpand(InStr, OutStr);
  InStr.Free;
  OutStr.Free;
end.

上一页  [1] [2] [3] [4] [5] [6] [7] 

打印本文 打印本文 关闭窗口 关闭窗口