title: Writing a 2D byte array to a text file Java
body: <p>So in the process of making an RPG in Java, I found that it would be nice to make a program that would allow me to create a map and save it without having to edit the numbers of a byte array. I need to be able to save the map to a text file such, that it can be read and recreated in the RPG. However I cant figure out how to write a 2D byte array to a file.</p>
  
  <p>For example:</p>
  
  <pre><code>byte[][] map = new byte[][]{ {0,0,0,0,0}, {1,1,1,0,0} };
  </code></pre>
  
  <p>I want the text file to be able to output something like this:</p>
  
  <pre><code>0 0 0 0 0
  1 1 1 0 0
  </code></pre>
  
  <p>How exactly would I go about writing the contents of a 2d byte array to a text file?</p>