I put a trace before is.read() and after is.read().
The trace of latter is not shown at all.
Code is as below
length = con.getLength(); //con is httpconnector object
is = con.openInputStream();
ByteArrayOutputStream baos = new ByteArrayOutputStream();
int b = 0;
if (length != -1)
{
buffer = new byte[(int) length];
is.readFully(buffer);
}
else
{
while ((b = is.read()) != -1) {//Device hangs in this loop forever.
baos.write(b);
}
buffer = baos.toByteArray();
Anyone faced this issue?
Can you let know if there is any issue in above code