Delphi Reverse order of bytes
I have been trying to write a function that takes two pointers (an input and an output) and writes the bytes from the input into the output in reverse order. So far I have not been able to make it work correctly. procedure ReverseBytes(Source, Dest: Pointer; Size: Integer); var Index: Integer; begin Move(Pointer(LongInt(Source) + Index)^, Pointer(LongInt(Dest) + (Size - Index))^ , 1); end; Can anyone please suggest a better way of doing this. Thanks. procedure ReverseBytes(Source, Dest: Pointer; Size: Integer); var Index: Integer; begin for Index := 0 to Size - 1 do Move(Pointer(LongInt(Source