MemoryStream does not contain a definition for GetBuffer()
问题 I've started working with C# and .NET Core and I'm trying to implement the code in the answer at https://stackoverflow.com/a/23739932/1459684 However, I have a problem with lines writer.Write(innerStream.GetBuffer(), 0, length); and var base64 = Convert.ToBase64String(stream.GetBuffer(), 0, (int)stream.Length).ToCharArray(); where the method getBuffer() no longer appears to be available. I receive the error: "'MemoryStream' does not contain a definition for 'GetBuffer' and no extension method