A tip, move the exception.create's on error to an own procedures e.g. something
procedure lz4errror(const Message:string);
begin
raise Exception.Create(message);
end;
it saves the need for exception frames, at least on targets that don't have tabled based exceptions.