Lh5Unit.pas压缩单元的问题,用过的人过来瞧瞧!! ( 积分: 50 )

  • 主题发起人 主题发起人 devilsniffer
  • 开始时间 开始时间
D

devilsniffer

Unregistered / Unconfirmed
GUEST, unregistred user!
procedure LHACompress(InStr, OutStr: TStream);<br>begin<br> &nbsp;InitMemory;<br> &nbsp;try<br> &nbsp; &nbsp;InFile := InStr;<br> &nbsp; &nbsp;OutFile := OutStr;<br> &nbsp; &nbsp;OrigSize := InFile.Size - InFile.Position;<br> &nbsp; &nbsp;CompSize := 0;<br> &nbsp; &nbsp;OutFile.Write(OrigSize,4);<br> &nbsp; &nbsp;Encode;<br> &nbsp;finally<br> &nbsp; &nbsp;FreeMemory;<br> &nbsp;end;<br>end;<br><br>procedure LHAExpand(InStr, OutStr: TStream);<br>begin<br> &nbsp;try<br> &nbsp; &nbsp;InitMemory;<br> &nbsp; &nbsp;InFile := InStr;<br> &nbsp; &nbsp;OutFile := OutStr;<br> &nbsp; &nbsp;CompSize := InFile.Size - InFile.Position;<br> &nbsp; &nbsp;InFile.Read(OrigSize,4);<br> &nbsp; &nbsp;Decode;<br> &nbsp;finally<br> &nbsp; &nbsp;FreeMemory;<br> &nbsp;end;<br>end;<br><br>单元里面上面两个过程分别是调用压缩和解压缩部分,但是是压缩和解压缩输出的是流,如何修改一下,让它输出的是文件形式?
 
procedure LHACompress(InStr, OutStr: TStream);<br>begin<br> &nbsp;InitMemory;<br> &nbsp;try<br> &nbsp; &nbsp;InFile := InStr;<br> &nbsp; &nbsp;OutFile := OutStr;<br> &nbsp; &nbsp;OrigSize := InFile.Size - InFile.Position;<br> &nbsp; &nbsp;CompSize := 0;<br> &nbsp; &nbsp;OutFile.Write(OrigSize,4);<br> &nbsp; &nbsp;Encode;<br> &nbsp;finally<br> &nbsp; &nbsp;FreeMemory;<br> &nbsp;end;<br>end;<br><br>procedure LHAExpand(InStr, OutStr: TStream);<br>begin<br> &nbsp;try<br> &nbsp; &nbsp;InitMemory;<br> &nbsp; &nbsp;InFile := InStr;<br> &nbsp; &nbsp;OutFile := OutStr;<br> &nbsp; &nbsp;CompSize := InFile.Size - InFile.Position;<br> &nbsp; &nbsp;InFile.Read(OrigSize,4);<br> &nbsp; &nbsp;Decode;<br> &nbsp;finally<br> &nbsp; &nbsp;FreeMemory;<br> &nbsp;end;<br>end;<br><br>单元里面上面两个过程分别是调用压缩和解压缩部分,但是是压缩和解压缩输出的是流,如何修改一下,让它输出的是文件形式?
 
后退
顶部