BufferedInputStream says it is not available, but works anyway
===

Can someone explain to me why this works just fine with in.available()>0 commented out, but when I put it back in it breaks?

    mySocket = new Socket("blahblah", 12345);
    BufferedInputStream in = new BufferedInputStream(mySocket.getInputStream());
    ....
    char result[] = new char[length];  		
    for (int i = 0; i < length && !mySocket.isClosed() /*&& in.available()>0*/; i++){
        result[i] = (char)in.read();
    }

More specifically: I'm making an Android app where a user can search for a term, that search is sent to some thingy in interspace, I get back results in xml form, and do stuff with them. When the xml I get back is small enough (see "length" in code above), the code works just fine with in.available()>0 left in. But if the length is large, in.available() returns 0. But with that commented out, everything continues to run smoothly.

Why is that? And is it something I need to worry about and fix?