title: DataInputStream.readFully()?
body: <p>I am working on an applet and it has to load files to a cache and I have got the downloading of the cache and unzipping down pat but now when I create the inputdatastream to read the cache I get an <code>EOFException</code>. </p>
  
  <p>I thought okay I'll surround it with a <code>try catch</code> and that is what I did but then when the client went to use the cache file it got an <code>ArrayIndexOutOfBounds</code> and stopped on the first loading. I am beginning to believe that <code>DataInputStream.readFully();</code> is reaching the end of the file because it is not able to see this. </p>
  
  <p>I can run this applet fine from eclipse/desktop and it downloads the cache and loads everything up so that is what leading me to think that the cache cannot be reached by the applet. I am running the applet with a simple <code>&lt;applet&gt;&lt;/applet&gt;</code> HTML file setup. I have tried setting the manifest with <code>Permissions: all-permissions</code> but I still get the same issue. I am self signing the applet but I can not get it to run remotely. </p>
  
  <p>I have also tried to set a .policy with grant <code>java.security.AllPermissions</code>. I might have missed something trying this so if you have any tips that would be appreciated. Been researching for days and have not been able to find a solution. Hope you all know a quick solution, I bet I am missing something. </p>
  
  <pre><code>    java.io.EOFException
      at java.io.DataInputStream.readFully(Unknown Source)
      at client.streamLoaderForName(client.java:5495)
      at client.startUp(client.java:10206)
      at RSApplet.run(RSApplet.java:84)
      at client.run(client.java:6740)
      at java.lang.Thread.run(Unknown Source)
  Error: loaderror Requesting title screen 25
  java.lang.ArrayIndexOutOfBoundsException: 6
      at Stream.readUnsignedWord(Stream.java:135)
      at StreamLoader.&lt;init&gt;(StreamLoader.java:21)
      at client.streamLoaderForName(client.java:5577)
      at client.startUp(client.java:10206)
      at RSApplet.run(RSApplet.java:84)
      at client.run(client.java:6740)
      at java.lang.Thread.run(Unknown Source)
  
      &lt;center&gt;
  &lt;applet name="Inspiration" width="765" height="503" archive="WC.jar" code="client.class"&gt;
  &lt;param name="java_arguments", value="-Xmx1024m"&gt;
  &lt;/applet&gt;
  &lt;center&gt;
  </code></pre>