title: Serialize .NET Array to XML as base 64?
body: <p>I'm writing a custom .NET serializer in C# and want to read and write Array objects to XML using XmlReader and XmlWriter. I would like to base64-encode the Array. The arrays may be 1-, 2- or 3-dimensional and the elements are bool or numeric types. </p>
  
  <p>I'm completely stumped. XmlReader and XmlWriter have methods for reading/writing Byte[] arrays as base64 but I can't figure out how to get from an Array to a Byte[] and back.</p>
  
  <p>The arrays could be large so I would prefer a solution that does not involve copying the array or processing one element at a time. Unsafe code and managed or native C++ are fine. I could use something other than base64 if it is safe for XML.</p>
  
  <p>Thanks for any help or hints.</p>