byte[] total = null;
byte[] extend;
int have;
byte[] res = new byte[4096];
int got;
while((got = in.read(res)) != -1)
{
extend = total;
have = extend.length;
total = new byte[have + got];
for(i = 0; i < have; ++i)
{
total[i] = extend[i];
}
for(i = 0; i < got; ++i)
{
total[have + i] = res[i];
}
}
;JOOP!
Main Topics
Browse All Topics





by: CEHJPosted on 2006-12-15 at 10:56:28ID: 18148118
>>This code gets 4096 byte of inputstream..
It get's *up to* 4096. Assign the result of read to an int. That will tell you how many bytes *were* read