mark(1); if ((read() & 0xFF) != '\n') reset(); }
next_c = read(); next_ch = (char) (next_c & 0xFF); if ((next_ch != '\n') && (next_c >= 0)) { mark(1); if ((read() & 0xFF) != '\n') reset(); } }     else ignoreInitialNewline = true;
  public final String readLine() throws IOException  {    StringBuffer strb = new StringBuffer();    while (true)      {	int c = read();	if (c < 0)	// got an EOF	  return strb.length() > 0 ? strb.toString() : null;	char ch = (char) c;	if ((ch &= 0xFF) == '\n')	  break;	if (ch == '\r')	  {	    // FIXME: The following code tries to adjust the stream back one	    // character if the next char read is '\n'.  As a last resort,	    // it tries to mark the position before reading but the bottom	    // line is that it is possible that this method will not properly	    // deal with a '\r' '\n' combination thus not fulfilling the	    // DataInput contract for readLine.  It's not a particularly	    // safe approach threadwise since it is unsynchronized and	    // since it might mark an input stream behind the users back.	    // Along the same vein it could try the same thing for	    // ByteArrayInputStream and PushbackInputStream, but that is	    // probably overkill since this is deprecated & BufferedInputStream	    // is the most likely type of input stream.	    //	    // The alternative is to somehow push back the next byte if it	    // isn't a '\n' or to have the reading methods of this class	    // keep track of whether the last byte read was '\r' by readLine	    // and then skip the very next byte if it is '\n'.  Either way,	    // this would increase the complexity of the non-deprecated methods	    // and since it is undesirable to make non-deprecated methods	    // less efficient, the following seems like the most reasonable	    // approach.	    if (in instanceof BufferedInputStream && (read() & 0xFF) != '\n')	      {	        BufferedInputStream bin = (BufferedInputStream) in;		if (bin.pos > 0)                  bin.pos--;	      }	    else if (markSupported())	      {		mark(1);		if ((read() & 0xFF) != '\n')		  reset();	      }	    break;	  }	strb.append(ch);      }    return strb.length() > 0 ? strb.toString() : "";  }