title: Cast object array to byte array
body: <p>I have an object array containing array of a different type that is not known at compile time, but turns out to be <code>int[]</code>, <code>double[]</code> etc.</p>
  
  <p>I want to save these arrays to disk and I don't really need to process their contents online, so I looking for a way to cast the <code>object[]</code> to a <code>byte[]</code> that I then can write to disk.</p>
  
  <p>How can I achieve this?</p>