java.io.IOException: Premature EOF
<p>Hi:
I am trying to download an xml file using Stream and things was fine , until the xml size became bigger than 9 MB , so i've got this error 
java.io.IOException: Premature EOF</p>

<p>this is the code </p>

<pre><code>BufferedInputStream bfi = null;
        try {
            bfi = new BufferedInputStream(new URL("The URL").openStream());
            String name = "name.xml";
            FileOutputStream fb = new FileOutputStream(name);
            BufferedOutputStream bout = new BufferedOutputStream(fb, 1024);
            byte[] data = new byte[1024];
            int x = 0;
            while ((x = bfi.read(data, 0, 1024)) &gt;= 0) {
                bout.write(data, 0, x);
            }
            this.deletePhishTankDatabase(this.recreateFileName());
            ptda.insertDownloadTime(hour, day, month, year);
            bout.close();
            bfi.close();
        } catch (IOException ex) {
            Logger.getLogger(PhishTankDataBase.class.getName()).log(Level.SEVERE, null, ex);
        } finally {
            try {
                bfi.close();
            } catch (IOException ex) {
                Logger.getLogger(PhishTankDataBase.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
    } else {
        System.out.println("You can't do anything");
        return;
    }
</code></pre>

<p>thanks in advanced </p>
