Woha! You are quite quick and you are most helpful too.

You should specify first element of array when loading the data:
This indeed got rid of the problem.
What is Size?
This is a property of TStream.
I asked myself the same question and came to the same conclusion. The "with" construction allows for abbreviated syntax later, disguising the origin.
I must declare that this is not my source code, but some other from
a project on GitHub. This function is in effect for quite some release now, so I must assume it does compile correctly working versions with suitable settings. The entire Lazarus project is part of the repository, so one might assume, it's a mere copy and run. Which it was not.

I usually try to replicate the known good behavior before I start "enhancing" other peoples code. If something breaks when using the original code, then i first assume a problem on my side - which usually is the correct assumption.
I have been spolied by relying on CLR compilers and VisualStudio for a few decades about what a compiler and a debugger can do about strongly (or weakly) typed objects.

Can you imagine a setting, where the original code is expected to work as written? A discrepancy in the complier or library version? The project relies on standard, supplied libraries only with additional "LazUtils" and "indylaz".
I have another code line that did not work out as expected:
var
LPointer: PChar;
LUnicode: Cardinal;
begin
...
LUnicode:=UTF8CodepointToUnicode(LPointer,LCPLen);
case Integer(LUnicode.Words[0]) of
...
end
It's line 8, the "case" line, where the Cardinal type gets read as record of Word. Since Cardinal is an alias to LongWord and that type has no structure, this must fail.
Is there a version where cardinal CAN be split with this syntax? I changed this to
as this should give me the lower word of a LongInteger. But I'm still uncertain, what causes the discrepancy in an obviously working Lazarus project. Just not working unaltered at my system.
At last there is a piece of code where an object derived directly from TFPHTTPServer is assumed to have parameters like "ThreadMode", "KeepConnections" and "KeepConnectionTimeout", which are not documented in the library - and indeed are not availale.
On the other hand I DID find these parameters in a WIKI page describing them for just this FCL object.
So I'm quite confused. Has there been any breaking change in the libraries? Do these things refer to way outdated version or maybe to upcoming releases? Even if I assume that setting up Lazarus/freepascal on Linux might be a bit different than with Windows - the code base and the compiled executables should be pretty much compatible.
And the published binaries for all versions of this project DO work.
