What is the best way to convert an array of bytes declared as TBytes to a RawByteString in Delphi 2009? This code actually works, maybe there is a faster way (without loop):
function Convert(Bytes: TBytes): RawByteString;
var
I: Integer;
begin
SetLength(Result, Length(Bytes));
for I := 0 to ABytes - 1 do
Result[I + 1] := AnsiChar(Bytes[I]);
end;