title: How to convert Map to Bytes and save to internal storage
body: <p>How can I convert my <code>Map&lt;Integer, String</code>> to <code>byte[]</code>, and then write it to internal storage? I currently have:</p>
  
  <pre><code>        try {
              FileOutputStream fos = context.openFileOutput(Const.FILE_CATEGORIES, Context.MODE_PRIVATE);
              fos.write(null);
          } catch (FileNotFoundException e) {
              // reload and create the file again
          }
  </code></pre>
  
  <p>But..I don't know how to get the <code>Map</code> into the correct format, and then decode it back to it's original format once I need to load it again. I need to recreate this file once per week, and load it on application startup.</p>