http://www.delphitop.com/html/zifuchuan/2789.html

将一个字符串转换成MemoryStream的函数.
function StringToMemory(s:string):TMemoryStream;
var
  bytes:TBytes;
  ms:TMemoryStream;
begin
      ms:=TMemoryStream.Create;
      bytes := TEnCoding.UTF8.GetBytes(s);
      ms.Write(bytes, Length(bytes));
      result:=ms;
end;