EldoS | Feel safer!

Software components for data protection, secure storage and transfer

deflateEnd in SBZCompressUnit

Also by EldoS: RawDisk
Access locked and protected files in Windows, read and write disks and partitions and more.
#8307
Posted: 11/29/2008 07:30:54
by Denis Sletkov (Standard support level)
Joined: 11/27/2007
Posts: 14

The deflateEnd procedure raise exception when try FreeMem(strm.internal);
Also in this procedure write :)
//******************************Ýòî íå ðàáîòàåò â Delphi !!! Ðàçîáðàòüñÿ !!!
#8308
Posted: 11/29/2008 08:07:31
by Eugene Mayevski (EldoS Corp.)

We don't offer low-level functions for public use, i.e. you should not call deflateEnd directly. If there's some code calling this method (and causing an exception to happen), please specify the details about that code.


Sincerely yours
Eugene Mayevski
#8310
Posted: 11/29/2008 08:48:35
by Denis Sletkov (Standard support level)
Joined: 11/27/2007
Posts: 14

I use FinalizeCompressionEx which use deflateEnd in internal compress function.
Code
procedure ZLibCompress(InStream, OutStream: TStream);
var
  BytesLeft, Size, OutSize: cardinal;
  Buffer, OutBuffer: ByteArray;
  Context: TZlibContext;
begin
  BytesLeft := InStream.Size - InStream.Position;

  SetLength(Buffer, BLOCK_SIZE);
  SetLength(OutBuffer, BLOCK_SIZE);

  InitializeCompressionEx(Context, 6);

  while BytesLeft > 0 do begin
    Size := InStream.Read(Buffer[0], Min(BLOCK_SIZE, BytesLeft));
    Dec(BytesLeft, Size);
    OutSize := BLOCK_SIZE;
    CompressEx(Context, @Buffer[0], Size, @OutBuffer[0], OutSize);
    OutStream.Write(OutBuffer[0], OutSize);
  end;

  FinalizeCompressionEx(Context, @OutBuffer[0], OutSize);
  if OutSize > 0 then OutStream.Write(OutBuffer[0], OutSize);
end;
#8311
Posted: 11/29/2008 09:26:55
by Eugene Mayevski (EldoS Corp.)

As said, those functions are not intended to be used by users, they are not documentaed and we don't provide support for them.


Sincerely yours
Eugene Mayevski

Reply

Statistics

Topic viewed 1068 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!