public String readLine() throws IOException {
  boolean gotCR=false, gotLF=false;
  pos=0;
  lineBuf=new StringBuffer();
  while (!gotLF) {
    int c=is.read();
    if (c == -1) {
      return null;
    }
    if (gotCR) {
      if (c == LF) {
        gotLF=true;
      }
 else {
        gotCR=false;
        consume(CR);
        consume(c);
      }
    }
 else {
      if (c == CR) {
        gotCR=true;
      }
 else {
        consume(c);
      }
    }
  }
  lineBuf.append(buf,0,pos);
  return new String(lineBuf);
}

public String readLine ( ) throws IOException { boolean gotCR = false , gotLF = false ; pos = 0 ; lineBuf = new StringBuffer ( ) ; while ( ! gotLF ) { int c = is . read ( ) ; if ( c == - 1 ) { return null ; } if ( gotCR ) { if ( c == LF ) { gotLF = true ; } else { gotCR = false ; consume ( CR ) ; consume ( c ) ; } } else { if ( c == CR ) { gotCR = true ; } else { consume ( c ) ; } } } lineBuf . append ( buf , 0 , pos ) ; return new String ( lineBuf ) ; }
read a line from the stream returning as a string . not used for reading headers .
