Is inputStream.available() guaranteed to work in this case? I read
that input streams for assets and resources are defined to work in
this way, but I wouldn't assume that this also applies to sdcard
files.
The alternative I'd try is:
ParcelFileDescriptor fd = contentResolver.openFileDescriptor(uri,
mode);
try {
fileSize = fd.getStatSize();
} finally {
fd.close();
}
Joe
On Jun 15, 3:17 pm, sazilla <[email protected]> wrote:
> Hi all,
>
> In my application I need to read Images filesizebefore reading and
> send them through the network.
> Actually it uses the MediaStore provider in order to read theSIZE
> field of the Images.
> All works as expected except for someHTCdevices (e.g. Legend and
> Desire) where the returnedSIZEvalue is not correct (it seems that
> only after a device reboot it stores the correct sizes).
> For that reason I applied a workaround for such devices that makes use
> of the InputStream.available() method in order to get the realImagesize.
> I know that it is not the best way to do that but I didn't find
> alternatives.
>
> Can somebody help me on that issue?
> Carlo
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en