EldoS | Feel safer!

Software components for data protection, secure storage and transfer

deflateEnd in SBZCompressUnit

Also by EldoS: CallbackDisk
Create virtual disks backed by memory or custom location, expose disk images as disks and more.
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 !!! Ðàçîáðàòüñÿ !!!
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
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.
procedure ZLibCompress(InStream, OutStream: TStream);
  BytesLeft, Size, OutSize: cardinal;
  Buffer, OutBuffer: ByteArray;
  Context: TZlibContext;
  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);

  FinalizeCompressionEx(Context, @OutBuffer[0], OutSize);
  if OutSize > 0 then OutStream.Write(OutBuffer[0], OutSize);
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



Topic viewed 1053 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!