I am using following lines of code to find out how many bytes are to be read from data input stream after i get its available length from httpConnection.
inputStream = httpConnection.openDataInputStream();
contentLength = (int)httpConnection.getLength();
now in some cases, i get contentLength = -1, which is giving -ive array index Exception.
till yet, i am unable to find out why it is giving me -1 count as I know there are contents available to be read on the server.
any suggestion about how to solve this issue.