I think I found a problem with SaveToStreamIEV where it will only saves all objects and not just a single object as the code suggest. e.g. hobj = -3 and pass to SaveObj(LZStream, hobj);
where as the code for SaveToStreamIEV saves all object to the stream
LZStream := TZCompressionStream.Create(Stream, zcDefault, 15);
try
LZStream.Write(fObjCount, sizeof(integer)); // object
SaveObj(LZStream, hobj);
finally
FreeAndNil(LZStream);
end;
I adjust the code and it seems to be ok but I'd thought I'd pass it on for review and hope it gets incorporated in a future release.
LZStream := TZCompressionStream.Create(Stream, zcDefault, 15);
try
vObjCount := 1;
if hObj = -3 then begin // save all objects
vObjCount := fObjCount;
end;
LZStream.Write(vObjCount, sizeof(integer)); // object
SaveObj(LZStream, hobj);
finally
FreeAndNil(LZStream);
end;