Out Of Memory Exception
<p>In my app i am giving video file path to FileInputStream class after that i want it
to convert into byte Array but it throws Out of memory Exception Please suggest me how
to do it.Iam posting the code here thanks in advance.</p>

<pre><code>public byte[] readBytes(InputStream inputStream) throws IOException
{       
    ByteArrayOutputStream byteBuffer = new ByteArrayOutputStream();  
    int bufferSize = 1024;     
    byte[] buffer = new byte[bufferSize];    
    int len = 0;    
    while ((len = inputStream.read(buffer)) != -1) 
    {         
       byteBuffer.write(buffer, 0, len);   
    }       
    return byteBuffer.toByteArray();
}  
</code></pre>
