In my C ++ \ CLI, I have this piece of code:
array<Byte>^ out_buf = gcnew array<Byte>(stream_size); Marshal::Copy(IntPtr(buf), out_buf, 0, Int32(stream_size)); System::IO::MemoryStream^ stream = gcnew MemoryStream(out_buf);
in a MemoryStream(out_buf) , does the memory stream allocate memory again or just go into the out_buf property?
if a MemoryStream allocates memory again, is there a way to convert my own buffer into a MemoryStream ?
source share