title: How to create byte[] with size using reflections?
body: <p><strong>Introduction</strong>:<br/>
  So, I'm using an API and I need to overwrite 2 100% identical functions, one returning byte[] and one returning short[]. To make sure I don't have to edit everything twice, I want to create a function returning the required one. But to achieve this I would need to create a byte[4096] or a short[4096] which cannot be casted to anything, so I thought about using reflections and check whether a byte[] or a short[] is required. <br>
  <strong>Problem</strong>:<br/>
  I don't know how to create a fixed-sized byte[] using reflections, so I'm asking this right here. <br><br><br>
  <strong>Solution</strong>:<br/></p>
  
  <pre><code>Array.newInstance(byte.class, size); // new byte[size];
  Array.newInstance(byte.class, size, size); // new byte[size][];
  Array.newInstance(byte.class, size1, size2); // new byte[size1][size2];
  </code></pre>