It seems that the compiler picks the wrong overload of TStream.Read. You can work around this by using CopyFrom instead:
If FPC 3.2.2 TStream does not have overloaded Read, Write functions, in which the parameter has the type TBytes.
Therefore, need to use Read(buffer[0],...) instead of Read(buffer,...). The same with Write.
Ah, right! My IDE fooled me here, cause I have the sources set to ones from
main despite using 3.2.2 as compiler.
@
cdbc: do as
ASerge said and then this will also work with newer versions of FPC. Or you can use my alternative with the
CopyFrom (which will also work across versions).