title: java: read large binary file
body: <p>I need to read out a given large file that contains 500000001 binaries. Afterwards I have to translate them into ASCII.</p>
  
  <p>My Problem occurs while trying to store the binaries in a large array. I get the warning at the definition of the array ioBuf:</p>
  
  <p>"The literal 16000000032 of type int is out of range."</p>
  
  <p>I have no clue how to save these numbers to work with them! Has somebody an idea?</p>
  
  <p>Here is my code:</p>
  
  <pre><code>public byte[] read(){
      try{
          BufferedInputStream in = new BufferedInputStream(new FileInputStream("data.dat"));
          ByteArrayOutputStream bs = new ByteArrayOutputStream();
          BufferedOutputStream out = new BufferedOutputStream(bs);
          byte[] ioBuf = new byte[16000000032];       
          int bytesRead;
          while ((bytesRead = in.read(ioBuf)) != -1){
              out.write(ioBuf, 0, bytesRead);
          }
            out.close();
            in.close();
            return bs.toByteArray();
  }
  </code></pre>