ONJava.com -- The Independent Source for Enterprise Java
oreilly.comSafari Books Online.Conferences.


AddThis Social Bookmark Button
  How Java Web Servers Work
Subject:   Another comment on Http Client source
Date:   2004-05-11 00:32:00
From:   Pissalou
Good piece of work. If you plan to copy the Http Client source, you should also do the following change to avoid having a nasty '?' character appending to your response string:

while (loop) {
if ( in.ready() ) {
int i=0;
i = in.read();// put a read() before test
while (i!=-1) {
sb.append((char) i);
i = in.read();//move after the append()