if (pos >= limit && fill () <= 0) return -1; return buffer[pos++];
boolean retAtEndOfBuffer = false;  int avail = limit - pos; if (count > avail) { if (avail > 0) count = avail; else { if (limit == buffer.length) markPos = -1; if (pos > limit) {  retAtEndOfBuffer = true; --pos; } if (markPos < 0) {  if (count >= buffer.length && !retAtEndOfBuffer) return in.read(buf, offset, count); pos = limit = 0; } avail = in.read(buffer, limit, buffer.length - limit); if (retAtEndOfBuffer && avail > 0 && buffer[limit] == '\n') { --avail; limit++; } if (avail < count) { if (avail <= 0) return avail; count = avail; } limit += avail; } } System.arraycopy(buffer, pos, buf, offset, count); pos += count; return count;
  public int read() throws IOException  {    synchronized (lock)      {	checkStatus();	if (pos >= limit && fill () <= 0)	  return -1;	return buffer[pos++];      }  }