Hi,

I'm trying to read an image (taken on camera) that I need to POST to a
server.
I'm using the following code:

<CODE>
        OutputStream os = urlConn.getOutputStream();

        ContentResolver cR = this.getContentResolver();
        InputStream is = cR.openInputStream(photoUri);
        BufferedInputStream buf = new BufferedInputStream(is);
        int readBytes = 0;

        while ((readBytes = buf.read()) != -1){
            os.write(readBytes);
        }

</CODE>

But when I debug, I find that readBytes never gets a -1 (i.e eof). Can
anyone tell what is wrong here?
Is there any other alternative to read photos taken by the phone
camera (get a stream or bytes) to be POSTed to services etc...


Cheers,
Tej

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to