I am creating an android app and want to read a file from sdcard and send it to a rest webservice. Everything works fine but when I read the file from sdcard its filesize is much bigger than its originalsize. A 10 KB file is getting 260 KB.
I am doing the following...
File f = new File(uri);
Log.d("ORIGINAL FILESIZE:"+f.length());
Filesize 10752 Bytes on SDCARD.
This is exactly the same size the image has on the phone.
Bitmap bmp = BitmapFactory.decodeFile(uri);
ByteArrayOutputStream bao = new ByteArrayOutputStream();
bmp.compress(Bitmap.CompressFormat.JPEG, 100, bao);
Log.d("FILESIZE AFTER:"+bao.size());
Filesize 260904 Bytes after decode / compress.
This is the filesize the server receives and writes to disk. It's the same Image and Quality but about 20 times bigger.
Does anyone know what I am doing wrong?