title: What causes jobb tool to throw FAT Full IOException?
body: <p>I am trying to use the Android <a href="https://www.google.com/url?sa=t&amp;rct=j&amp;q=&amp;esrc=s&amp;source=web&amp;cd=3&amp;cad=rja&amp;ved=0CD4QFjAC&amp;url=http://developer.android.com/tools/help/jobb.html&amp;ei=nGU7Uv_IK8nlyAGBqIHgCA&amp;usg=AFQjCNHUPw9RCMsLC_B3ni-g_idn41LYdQ&amp;sig2=LF0DBRaYRtcq5OcDhNlHpw&amp;bvm=bv.52434380,d.aWc" rel="noreferrer">jobb tool</a> to create a large OBB file for my application, but I am plagued by the "FAT Full" IOException:</p>
  
  <pre><code>java.io.IOException: FAT Full (XXXX, YYYY)
      at de.waldheinz.fs.fat.Fat.allocNew(Fat.java:298)
      at de.waldheinz.fs.fat.Fat.allocAppend(Fat.java:376)
      at de.waldheinz.fs.fat.ClusterChain.setChainLength(ClusterChain.java:175)
      at de.waldheinz.fs.fat.ClusterChain.setSize(ClusterChain.java:132)
      at de.waldheinz.fs.fat.FatFile.setLength(FatFile.java:91)
      at de.waldheinz.fs.fat.FatFile.write(FatFile.java:154)
      at com.android.jobb.Main$1.processFile(Main.java:495)
      at com.android.jobb.Main.processAllFiles(Main.java:604)
      at com.android.jobb.Main.processAllFiles(Main.java:600)
      at com.android.jobb.Main.main(Main.java:417)
  Exception in thread "main" java.lang.RuntimeException: Error getting/writing file with name: LAST_PROCESSED_FILE
      at com.android.jobb.Main$1.processFile(Main.java:501)
      at com.android.jobb.Main.processAllFiles(Main.java:604)
      at com.android.jobb.Main.processAllFiles(Main.java:600)
      at com.android.jobb.Main.main(Main.java:417)
  </code></pre>
  
  <p>In the above error message, <strong>XXXX</strong> is always printed as exactly one integral value lower than <strong>YYYY</strong>, and represents the number of usable "clusters" (I'm not versed enough in storage jargon to know exactly what this means). YYYY represents the last successfully allocated cluster index, which in my experience is always the same as the last usable cluster index (the array is sized at XXXX + 2, so XXXX + 1 which is the same as YYYY is the last usable index).</p>
  
  <p>The crash seems to appear at the point at which the total file size exceeds 511 MB (the <strong>actual</strong> limit is <strong>536,193,820 bytes</strong>, a single byte more causes the overflow!), so <strong>LAST_PROCESSED_FILE</strong> is rather arbitrary, but it lists the file being processed when the crash occurred. Given that the storage format is FAT16 (from what I've been told), shouldn't the maximum file size then be 2 GB?</p>
  
  <p>I have read through various sources that empty or small directories or files, small total file size, or individual files within the directory over 500 MB can cause this crash (though I have not been able to determine why). None of these reasons are applicable to my case (which again, is based on total file size).</p>
  
  <p>My own review of the <a href="https://android.googlesource.com/platform/tools/base/+/c6d5146db825efac637786683efb92b66276900b/jobb/src/main/java/com/android/jobb" rel="noreferrer">jobb tool source</a> has not provided any insight. Can anyone <strong>please</strong> shed any light on this issue?</p>