BitmapFactory.decodeByteArray returns null in android
<p>In my application I am converting base64 string to image.For that I initially converted base 64 file to byte array and later am trying to convert to images.
To convert to Images I am using the below code</p>

<pre><code>    File sdImageMainDirectory = new File("/data/data/com.ayansys.Base64trial");
    FileOutputStream fileOutputStream = null;
    String nameFile="Images";
    try {

        BitmapFactory.Options options=new BitmapFactory.Options();
        options.inSampleSize = 5;
        options.inDither = true; 
        options.inPreferredConfig = Bitmap.Config.ARGB_8888;
        Bitmap myImage = BitmapFactory.decodeByteArray(imageData, 0, imageData.length);


        fileOutputStream = new FileOutputStream(
                sdImageMainDirectory.toString() +"/" + nameFile + ".jpg");


        BufferedOutputStream bos = new BufferedOutputStream(
                fileOutputStream);

        myImage.compress(CompressFormat.JPEG, quality, bos);

        bos.flush();
        bos.close();
</code></pre>

<p>but am getting my image as null at</p>

<pre><code>Bitmap myImage = BitmapFactory.decodeByteArray(imageData, 0, imageData.length);
</code></pre>

<p>Please let me know your valuable suggestions.</p>

<p>Thanks in advance :)</p>
