title: Java InputStream reading problem
body: <p>I have a Java class, where I'm reading data in via an InputStream</p>
  
  <pre><code>    byte[] b = null;
      try {
          b = new byte[in.available()];
          in.read(b);
      } catch (IOException e) {
          e.printStackTrace();
      }
  </code></pre>
  
  <p>It works perfectly when I run my app from the IDE (Eclipse).</p>
  
  <p>But when I export my project and it's packed in a JAR, the read command doesn't read all the data. How could I fix it?</p>
  
  <p>This problem mostly occurs when the InputStream is a File (~10kb).</p>
  
  <p>Thanks!</p>