Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link

Nick Revak

Greenhorn
+ Follow
since Jun 08, 2003
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Nick Revak

o'reilly has a servlet which can help. Take a look at the info here ...
http://www.servlets.com/cos/index.html
The third parameter in the read is the maximum characters to attempt to read.
You could simply try setting your array size to a value much bigger than your would ever expect for contentLength.
But I also think you'd want to do your reads within a while loop (checking for end of stream). If you do this, you need to manage the size of each read to ensure you don't exceed your array.
Try this ....
int currentArrayPos = 0;
int count = 0;
//then, change the max char parameter in your read ....
while ((count = br.read(buf, 0, contentLength - currentArrayPos) != -1 ) {; //***HERE'S THE PROBLEM!!
// and limit the size of each read
currentArrayPos = currentArrayPos + count
}
Congrats, Barry. Well done.
18 years ago
Thanks for the warm welcome.
18 years ago