Why is Base64 string different in C# and Android
<p>I have convert one image into base64 string and that output same with online website.</p>

<p>But the same image when I convert it from Android is different.</p>

<p>Can you please explain why C# and Android base64 strings are different for the same image.</p>

<p>C#.NET Code</p>

<pre><code>string cImagePath = @"G:\bg-listing.png";
byte[] imagebyte = StreamFile(cImagePath);
String result = System.Convert.ToBase64String(imagebyte);
System.IO.StreamWriter outFile;
try
{
    outFile = new System.IO.StreamWriter(Application.StartupPath + "//image2base641.txt",
                                     false,
                                     System.Text.Encoding.Default);
                outFile.Write(result.ToString());
                outFile.Close();
            }
            catch (System.Exception exp)
            {
                // Error creating stream or writing to it.
                System.Console.WriteLine("{0}", exp.Message);
            }
</code></pre>

<p>Android Code</p>

<pre><code>Bitmap bitmapOrg = BitmapFactory.decodeResource(getResources(),  R.drawable.image);
ByteArrayOutputStream bao = new ByteArrayOutputStream();
bitmapOrg.compress(Bitmap.CompressFormat.JPEG, 100, bao);
byte [] ba = bao.toByteArray();
 String ba1=Base64.encodeToString(ba,Base64.DEFAULT);
</code></pre>

<p>Both image base64 are different.</p>

<p>Please help me.</p>
