亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? zlib.pas

?? 比較經典的壓縮算法
?? PAS
?? 第 1 頁 / 共 2 頁
字號:
{*******************************************************}
{                                                       }
{       Delphi Supplemental Components                  }
{       ZLIB Data Compression Interface Unit            }
{                                                       }
{       Copyright (c) 1997 Borland International        }
{                                                       }
{*******************************************************}

unit zlib;

interface

uses Sysutils, Classes;

type
  TAlloc = function (AppData: Pointer; Items, Size: Integer): Pointer;
  TFree = procedure (AppData, Block: Pointer);

  // Internal structure.  Ignore.
  TZStreamRec = packed record
    next_in: PChar;       // next input byte
    avail_in: Integer;    // number of bytes available at next_in
    total_in: Integer;    // total nb of input bytes read so far

    next_out: PChar;      // next output byte should be put here
    avail_out: Integer;   // remaining free space at next_out
    total_out: Integer;   // total nb of bytes output so far

    msg: PChar;           // last error message, NULL if no error
    internal: Pointer;    // not visible by applications

    zalloc: TAlloc;       // used to allocate the internal state
    zfree: TFree;         // used to free the internal state
    AppData: Pointer;     // private data object passed to zalloc and zfree

    data_type: Integer;   //  best guess about the data type: ascii or binary
    adler: Integer;       // adler32 value of the uncompressed data
    reserved: Integer;    // reserved for future use
  end;

  // Abstract ancestor class
  TCustomZlibStream = class(TStream)
  private
    FStrm: TStream;
    FStrmPos: Integer;
    FOnProgress: TNotifyEvent;
    FZRec: TZStreamRec;
    FBuffer: array [Word] of Char;
  protected
    procedure Progress(Sender: TObject); dynamic;
    property OnProgress: TNotifyEvent read FOnProgress write FOnProgress;
    constructor Create(Strm: TStream);
  end;

{ TCompressionStream compresses data on the fly as data is written to it, and
  stores the compressed data to another stream.

  TCompressionStream is write-only and strictly sequential. Reading from the
  stream will raise an exception. Using Seek to move the stream pointer
  will raise an exception.

  Output data is cached internally, written to the output stream only when
  the internal output buffer is full.  All pending output data is flushed
  when the stream is destroyed.

  The Position property returns the number of uncompressed bytes of
  data that have been written to the stream so far.

  CompressionRate returns the on-the-fly percentage by which the original
  data has been compressed:  (1 - (CompressedBytes / UncompressedBytes)) * 100
  If raw data size = 100 and compressed data size = 25, the CompressionRate
  is 75%

  The OnProgress event is called each time the output buffer is filled and
  written to the output stream.  This is useful for updating a progress
  indicator when you are writing a large chunk of data to the compression
  stream in a single call.}


  TCompressionLevel = (clNone, clFastest, clDefault, clMax);

  TCompressionStream = class(TCustomZlibStream)
  private
    function GetCompressionRate: Single;
  public
    constructor Create(CompressionLevel: TCompressionLevel; Dest: TStream);
    destructor Destroy; override;
    function Read(var Buffer; Count: Longint): Longint; override;
    function Write(const Buffer; Count: Longint): Longint; override;
    function Seek(Offset: Longint; Origin: Word): Longint; override;
    property CompressionRate: Single read GetCompressionRate;
    property OnProgress;
  end;

{ TDecompressionStream decompresses data on the fly as data is read from it.

  Compressed data comes from a separate source stream.  TDecompressionStream
  is read-only and unidirectional; you can seek forward in the stream, but not
  backwards.  The special case of setting the stream position to zero is
  allowed.  Seeking forward decompresses data until the requested position in
  the uncompressed data has been reached.  Seeking backwards, seeking relative
  to the end of the stream, requesting the size of the stream, and writing to
  the stream will raise an exception.

  The Position property returns the number of bytes of uncompressed data that
  have been read from the stream so far.

  The OnProgress event is called each time the internal input buffer of
  compressed data is exhausted and the next block is read from the input stream.
  This is useful for updating a progress indicator when you are reading a
  large chunk of data from the decompression stream in a single call.}

  TDecompressionStream = class(TCustomZlibStream)
  public
    constructor Create(Source: TStream);
    destructor Destroy; override;
    function Read(var Buffer; Count: Longint): Longint; override;
    function Write(const Buffer; Count: Longint): Longint; override;
    function Seek(Offset: Longint; Origin: Word): Longint; override;
    property OnProgress;
  end;



{ CompressBuf compresses data, buffer to buffer, in one call.
   In: InBuf = ptr to compressed data
       InBytes = number of bytes in InBuf
  Out: OutBuf = ptr to newly allocated buffer containing decompressed data
       OutBytes = number of bytes in OutBuf   }
procedure CompressBuf(const InBuf: Pointer; InBytes: Integer;
                      out OutBuf: Pointer; out OutBytes: Integer);


{ DecompressBuf decompresses data, buffer to buffer, in one call.
   In: InBuf = ptr to compressed data
       InBytes = number of bytes in InBuf
       OutEstimate = zero, or est. size of the decompressed data
  Out: OutBuf = ptr to newly allocated buffer containing decompressed data
       OutBytes = number of bytes in OutBuf   }
procedure DecompressBuf(const InBuf: Pointer; InBytes: Integer;
 OutEstimate: Integer; out OutBuf: Pointer; out OutBytes: Integer);

const
  zlib_Version = '1.0.4';

type
  EZlibError = class(Exception);
  ECompressionError = class(EZlibError);
  EDecompressionError = class(EZlibError);

implementation

const
  Z_NO_FLUSH      = 0;
  Z_PARTIAL_FLUSH = 1;
  Z_SYNC_FLUSH    = 2;
  Z_FULL_FLUSH    = 3;
  Z_FINISH        = 4;

  Z_OK            = 0;
  Z_STREAM_END    = 1;
  Z_NEED_DICT     = 2;
  Z_ERRNO         = (-1);
  Z_STREAM_ERROR  = (-2);
  Z_DATA_ERROR    = (-3);
  Z_MEM_ERROR     = (-4);
  Z_BUF_ERROR     = (-5);
  Z_VERSION_ERROR = (-6);

  Z_NO_COMPRESSION       =   0;
  Z_BEST_SPEED           =   1;
  Z_BEST_COMPRESSION     =   9;
  Z_DEFAULT_COMPRESSION  = (-1);

  Z_FILTERED            = 1;
  Z_HUFFMAN_ONLY        = 2;
  Z_DEFAULT_STRATEGY    = 0;

  Z_BINARY   = 0;
  Z_ASCII    = 1;
  Z_UNKNOWN  = 2;

  Z_DEFLATED = 8;


{$L obj\deflate.obj}
{$L obj\inflate.obj}
{$L obj\inftrees.obj}
{$L obj\trees.obj}
{$L obj\adler32.obj}
{$L obj\infblock.obj}
{$L obj\infcodes.obj}
{$L obj\infutil.obj}
{$L obj\inffast.obj}

procedure _tr_init; external;
procedure _tr_tally; external;
procedure _tr_flush_block; external;
procedure _tr_align; external;
procedure _tr_stored_block; external;
procedure adler32; external;
procedure inflate_blocks_new; external;
procedure inflate_blocks; external;
procedure inflate_blocks_reset; external;
procedure inflate_blocks_free; external;
procedure inflate_set_dictionary; external;
procedure inflate_trees_bits; external;
procedure inflate_trees_dynamic; external;
procedure inflate_trees_fixed; external;
procedure inflate_trees_free; external;
procedure inflate_codes_new; external;
procedure inflate_codes; external;
procedure inflate_codes_free; external;
procedure _inflate_mask; external;
procedure inflate_flush; external;
procedure inflate_fast; external;

procedure _memset(P: Pointer; B: Byte; count: Integer);cdecl;
begin
  FillChar(P^, count, B);
end;

procedure _memcpy(dest, source: Pointer; count: Integer);cdecl;
begin
  Move(source^, dest^, count);
end;



// deflate compresses data
function deflateInit_(var strm: TZStreamRec; level: Integer; version: PChar;
  recsize: Integer): Integer; external;
function deflate(var strm: TZStreamRec; flush: Integer): Integer; external;
function deflateEnd(var strm: TZStreamRec): Integer; external;

// inflate decompresses data
function inflateInit_(var strm: TZStreamRec; version: PChar;
  recsize: Integer): Integer; external;
function inflate(var strm: TZStreamRec; flush: Integer): Integer; external;
function inflateEnd(var strm: TZStreamRec): Integer; external;
function inflateReset(var strm: TZStreamRec): Integer; external;


function zlibAllocMem(AppData: Pointer; Items, Size: Integer): Pointer;
begin
  GetMem(Result, Items*Size);
end;

procedure zlibFreeMem(AppData, Block: Pointer);
begin
  FreeMem(Block);
end;

function zlibCheck(code: Integer): Integer;
begin
  Result := code;
  if code < 0 then
    raise EZlibError.Create('error');    //!!
end;

function CCheck(code: Integer): Integer;
begin
  Result := code;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲日本青草视频在线怡红院| 精品久久久影院| av电影一区二区| 国产一区二区三区av电影| 亚洲国产va精品久久久不卡综合| 国产精品久久久久久久久免费丝袜| 欧美va天堂va视频va在线| 日韩午夜小视频| 日韩美女主播在线视频一区二区三区| 在线观看免费成人| 在线不卡欧美精品一区二区三区| 欧美色视频在线观看| 欧美肥大bbwbbw高潮| 91精品婷婷国产综合久久性色 | 精品欧美黑人一区二区三区| 91超碰这里只有精品国产| 在线成人免费观看| 日韩精品一区二区三区在线| 久久久久青草大香线综合精品| 国产欧美一区二区三区沐欲| 欧美国产日产图区| 亚洲女女做受ⅹxx高潮| 五月婷婷激情综合网| 美女看a上一区| 国产很黄免费观看久久| aa级大片欧美| 制服.丝袜.亚洲.另类.中文| 精品区一区二区| 亚洲欧洲在线观看av| 亚洲亚洲人成综合网络| 裸体一区二区三区| 成人污污视频在线观看| 欧美午夜片在线看| 久久在线免费观看| 亚洲精品第1页| 日韩经典一区二区| 国产福利91精品一区| 欧美在线视频全部完| www成人在线观看| 曰韩精品一区二区| 黄色日韩三级电影| 在线亚洲免费视频| 久久午夜电影网| 亚洲成a人v欧美综合天堂| 国产成人亚洲精品青草天美| 在线视频你懂得一区二区三区| 欧美一级二级三级蜜桃| 亚洲视频一区二区在线| 国产呦萝稀缺另类资源| 欧美在线一区二区| 国产精品国产三级国产aⅴ中文 | 6080国产精品一区二区| 国产精品网曝门| 蜜桃av噜噜一区二区三区小说| 99热精品国产| 26uuu久久综合| 亚洲18影院在线观看| 99精品久久免费看蜜臀剧情介绍| 欧美一二三在线| 香蕉久久夜色精品国产使用方法| 成人手机电影网| 精品国产欧美一区二区| 日韩激情一区二区| 欧亚一区二区三区| 亚洲日本在线天堂| 成人福利在线看| 久久亚洲一区二区三区四区| 日韩精品一级中文字幕精品视频免费观看 | 国产永久精品大片wwwapp| 欧美三级在线看| 成人免费在线视频观看| 国产一区 二区| 精品日韩一区二区| 亚洲国产综合人成综合网站| 99精品桃花视频在线观看| 国产午夜亚洲精品不卡| 国产在线视视频有精品| 精品国产91久久久久久久妲己| 午夜影院在线观看欧美| 欧美撒尿777hd撒尿| 亚洲国产精品久久人人爱蜜臀 | 亚洲曰韩产成在线| 91久久精品一区二区| 中文字幕字幕中文在线中不卡视频| 国产麻豆成人精品| 国产视频一区在线观看| 国产91精品在线观看| 国产欧美一区二区三区沐欲| 成人免费高清在线| 亚洲欧美日韩国产成人精品影院| 色哟哟精品一区| 亚洲成人动漫在线观看| 欧美一区二区三区在| 久久不见久久见中文字幕免费| 精品国产一区a| 大胆亚洲人体视频| 一区二区免费看| 正在播放一区二区| 国产美女主播视频一区| 国产精品久久久久久久岛一牛影视 | 亚洲不卡av一区二区三区| 在线观看免费一区| 日韩av中文字幕一区二区三区| 欧美精品丝袜久久久中文字幕| 偷拍一区二区三区四区| 久久综合色之久久综合| eeuss鲁片一区二区三区在线看| 亚洲精品国产成人久久av盗摄| 制服丝袜日韩国产| av在线一区二区三区| 日日骚欧美日韩| 国产日产欧美一区| 欧美精品在线视频| jiyouzz国产精品久久| 丝袜诱惑亚洲看片| 国产精品欧美一区二区三区| 欧美三级电影一区| 成人一二三区视频| 日本女优在线视频一区二区| 欧美国产精品中文字幕| 777午夜精品视频在线播放| 99国产精品久久久久久久久久久 | 欧美一卡二卡在线| eeuss鲁片一区二区三区在线观看 eeuss鲁片一区二区三区在线看 | 成人免费毛片a| 偷拍亚洲欧洲综合| 国产欧美日韩在线| 91精品国产综合久久精品app| 国产91精品精华液一区二区三区| 天天做天天摸天天爽国产一区| 国产女同性恋一区二区| 日韩一级片网址| 色噜噜夜夜夜综合网| 国产91精品免费| 久久精品国产精品青草| 亚洲午夜在线观看视频在线| 国产精品欧美久久久久一区二区| 日韩欧美123| 欧美精品aⅴ在线视频| 91麻豆免费看| 成人一区在线观看| 国产精品一区二区三区99| 日本亚洲电影天堂| 午夜精品久久久久影视| 亚洲男女毛片无遮挡| 国产精品久久毛片| 国产精品久久久久影院亚瑟| 久久精品人人爽人人爽| 久久青草欧美一区二区三区| 日韩精品一区二区三区swag| 91精品国产欧美一区二区18| 欧美日韩精品是欧美日韩精品| 在线视频中文字幕一区二区| 在线免费观看一区| 在线精品亚洲一区二区不卡| 色婷婷久久久亚洲一区二区三区 | 在线观看亚洲精品| 不卡视频免费播放| 一本色道久久综合亚洲aⅴ蜜桃| av电影天堂一区二区在线| av成人免费在线观看| 一道本成人在线| 欧美在线你懂的| 欧美群妇大交群的观看方式| 欧美精品亚洲二区| 欧美大片一区二区| 久久久综合视频| 国产精品久久久久婷婷二区次| 中文字幕一区二区三区四区不卡| 自拍av一区二区三区| 亚洲自拍偷拍av| 日本三级韩国三级欧美三级| 国模冰冰炮一区二区| 大尺度一区二区| 日本高清无吗v一区| 欧美疯狂做受xxxx富婆| 精品日韩一区二区三区| 中文幕一区二区三区久久蜜桃| 亚洲美女精品一区| 日韩成人一级大片| 国产99久久久国产精品免费看| 91亚洲精品一区二区乱码| 欧美日韩亚洲不卡| 日韩欧美国产综合一区| 欧美激情艳妇裸体舞| 亚洲一区二区三区在线看| 精品制服美女丁香| 99精品偷自拍| 欧美va亚洲va在线观看蝴蝶网| 中文字幕日韩一区| 蜜臀av一区二区在线免费观看| 丁香婷婷综合五月| 欧美精品欧美精品系列| 欧美激情一二三区| 午夜一区二区三区视频| av不卡在线观看| 亚洲精品在线一区二区| 一区二区三区在线视频观看58| 久久se这里有精品| 欧美性做爰猛烈叫床潮|