I have created FileOutputStream object, and in that file i have written byte array of size 2515 bytes. I saved file on SD Card as PNG image. After seeing properties of that image size changes to 2389 bytes. I checked that byte array in HexEditor and created another PNG, its size is 2515 bytes it was right. Below is my code to write byte array in PNG file.Please let me know, where i am wrong. Thanks in advance.
FileOutputStream outStream = new FileOutputStream(Path);
int nLen = byteArray.length;
for(int i = 0 ; i < nLen ; i++)
{
outStream.write(byteArray[i]);
}
outStream.flush();
outStream.close();
This is other method i have tried
FileOutputStream outStream1 = new FileOutputStream(m_strRgnGroupPath);
int nLen = byteArray.length;
outStream1.write(byteArray,0,nLen);
outStream1.flush();
outStream1.close();
Aucun commentaire:
Enregistrer un commentaire