that's not the point:
I think you'll want to set your ch=br.read(); before you make the check against != '%'.
and then, add as last line in your while:
ch = br.read();
if this does not solve your problem, can you paste your entire error message here?
stultuske
Posting Sensei
3,137 posts since Jan 2007
Reputation Points: 1,114
Solved Threads: 433
All you need to perform the assignment before the test is an extra set of (). ie
while ( (ch=br.read()) != '%')
However, you still have a problem because br.read() returns an int not a char. You can't assign an int (32 bit) to a char (16 bit), although you can cast an int to a char at your own risk. It's OK to compare an int with a char because the char is converted to int without problem, so the quickest fix to the code you posted is to replace ch with an int.
And, of course, you'll have to handle the IOException.
JamesCherrill
Posting Genius
6,373 posts since Apr 2008
Reputation Points: 2,130
Solved Threads: 1,073
Maybe it's an end-of-file thing. read() returns -1 at end of file but you don't test for that, so maybe its looping at EOF with a return value -1 ?
JamesCherrill
Posting Genius
6,373 posts since Apr 2008
Reputation Points: 2,130
Solved Threads: 1,073
could you please paste the entire error message? the above is saying very little.
stultuske
Posting Sensei
3,137 posts since Jan 2007
Reputation Points: 1,114
Solved Threads: 433