[fpc-pascal] Asci85

José Mejuto joshyfun at gmail.com
Fri Sep 16 15:01:39 CEST 2016


El 16/09/2016 a las 10:16, Santiago A. escribió:

Hello,

>      StrmEnc85:=TAscii85EncoderStream.Create(StrmOut,72,True);
>      try
>        StrmEnc85.CopyFrom(StrmIn,0);
>        Result:=StrmOut.DataString;
>      finally
>        StrmEnc85.Free;

Maybe there is something wrong in ASCII85 encoder, but this code is 
wrong, it should be something like:

       try
         StrmEnc85.CopyFrom(StrmIn,0);
         StrmEnc85.Free;
         Result:=StrmOut.DataString;
       finally

Because stream must be flushed before extracting result and the flush is 
performed in the destroy.

Saludos!.

-- 




More information about the fpc-pascal mailing list