We had the following code prior to Delphi 2009:
function MemoryStreamToString(M : TMemoryStream): String; var NewCapacity: Longint; begin if (M.Size
Or perhaps you can refactor your code to use directly a TStringStream directly? You can use it instead of TMemoryStream (they have the same interface) and you can 'convert' it to a string by simply calling myString := myStringStream.DataString;