IOException while closing BufferedInputStream
<p>Following is the exception that I get: <code>java.io.IOException: I/O error</code></p>

<pre><code>04-13 07:11:35.040 W/System.err(  986):     at libcore.io.IoUtils.close(Native Method)
04-13 07:11:35.040 W/System.err(  986):     at java.io.FileInputStream.close (FileInputStream.java:139)
04-13 07:11:35.040 W/System.err(  986):     at java.io.BufferedInputStream.close (BufferedInputStream.java:134)
</code></pre>

<p>Following is my code snippet:</p>

<pre><code>public static void compress(String inFileName, String outFileName) { 
    GZIPOutputStream out = null;
    BufferedInputStream bin = null;
    FileOutputStream fileOutputStream = null; 
    FileInputStream fileInputStream = null;
    File inFile = null;
    try {
        inFile = new File(inFileName);
        if(inFile.exists()) 
        {

                fileOutputStream = new FileOutputStream(outFileName);
                out = new GZIPOutputStream(fileOutputStream);


                fileInputStream = new FileInputStream(inFileName);
                bin = new BufferedInputStream(fileInputStream);




            if(inFile.exists())
            {
                inFile.delete();
            }


            // Reading from buffer and writing it to file
            byte[] buf = new byte[1024];
            FileOutputStream inFileOutputStream = null;
            int len;
            try
            {
                while((len = bin.read(buf)) &gt; 0) {
                    out.write(buf, 0, len);
                }

              //Close the inputstream since it is not required any more.

                fileInputStream.close();
                fileInputStream = null;

            }
            catch(Exception e)
            {


            }
            finally
            {

            }

            out.finish();
        }
        else
        {

        }
    } catch (IOException e) {
        throw new MyException(e.getMessage(),e);
    }
    catch(MotoDCException e)
    {
        throw new MyException(e.getMessage(),e);
    }
    finally
    {
        try
        {


            if(bin != null)
            {
                bin.close();
                bin = null;
            }

            if(fileOutputStream != null)
            {
                fileOutputStream.close();
                fileOutputStream = null;
            }
            if(out != null)
            {                   
                out.close();
                out = null;
            }
            inFile = null;
        }
        catch(IOException e)
        {

            throw new MyException(e.getMessage(), e);
        }
    }

}
</code></pre>

<p>I get the exception only on an Android 3.0 device, when I try to close <code>bufferedInputStream</code> in the last finally block.</p>
