title: Concatenating image byte arrays
body: <p>I have <code>byte arrays</code> stored in the database, previously converted from <code>BufferedImage</code> with:</p>
  
  <pre><code>ImageIO.write(bufferedImage, extension, bao);
  return bao.toByteArray();
  </code></pre>
  
  <p>With those images I want to create a texture atlas (i.e. a sprite sheet). The most naive solution would be to convert every single <code>byte[]</code> back to a <code>BufferedImage</code> (about 500k times), write them to the texture atlas, and when done, convert the texture atlas' <code>BufferedImage</code> to <code>byte[]</code> back.</p>
  
  <p>I guess the most elegant way would be to just concatenate all <code>byte arrays</code>, yet I doubt that would work (with headers etc.), or would it?</p>