Hi, I added the following code, however, I got an OutOfMemoryError. It
comes from the bos.flush() line... Am I doing it wrong? I

BufferedOutputStream bos = new BufferedOutputStream(os);
bm.compress(CompressFormat.JPEG, 100, bos);

try {
        bos.flush();
        bos.close();
        os.close();
} catch (IOException e) {
        e.printStackTrace();
}
conn.disconnect();

Thank you!



>
> bm.compress(CompressFormat.PNG, 100, os);
>
> Note that PNG is lossless and will ignore the 2nd argument.
> Now, the API *could* have a helper method called save(CompressFormat,
> Stream) passing the max quality as a default 2nd parameter but that's
> another story...
>
> Cheers,
> Stoyan
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to