Borland的C#B的ZStream,就是对应VCL的那个ZLIB的压缩怎么用?(100分)

  • 主题发起人 主题发起人 wr960204
  • 开始时间 开始时间
W

wr960204

Unregistered / Unconfirmed
GUEST, unregistred user!
Borland的C#B的ZStream,就是对应VCL的那个ZLIB的压缩怎么用?
 
Procedure ZLibCompress(Const aSourceStream: TStream;
Var aDestStream: TStream);
Var
Len: Integer;
DecompressionStream: TCompressionStream;
begin
If aSourceStream.Size = 0 then
Exit;
DecompressionStream := TCompressionStream.Create(clDefault, aDestStream);
Try
Len := aSourceStream.Size;
DecompressionStream.Write(Len, SizeOf(Integer));
DecompressionStream.CopyFrom(aSourceStream, Len);
Finally
DecompressionStream.Free;
end;
end;

Procedure ZLibDeCompress(Const aSourceStream: TStream;
Var aDestStream: TStream);
Var
DecompressionStream: TDecompressionStream;
Len: Integer;
begin
DecompressionStream := TDecompressionStream.Create(aSourceStream);
Try
DecompressionStream.Read(Len, SizeOf(Integer));
If Len <> 0 then
aDestStream.CopyFrom(DecompressionStream, Len);
Finally
DecompressionStream.Free;
end;
end;
 
我问的不是Delphi而是c#Builder
 

Similar threads

后退
顶部