How can I write MemoryStream to byte[] [duplicate] March 19, 2023 by Tarik How about: byte[] bytes = fs.ToArray();