code: @SuppressWarnings("fallthrough")
      public int read(char cbuf[], int off, int len) throws IOException {
          synchronized (lock) {
              int n = super.read(cbuf, off, len);
  
              for (int i = off; i < off + n; i++) {
                  int c = cbuf[i];
                  if (skipLF) {
                      skipLF = false;
                      if (c == '\n')
                          continue;
                  }
                  switch (c) {
                  case '\r':
                      skipLF = true;
                  case '\n':      /* Fall through */
                      lineNumber++;
                      break;
                  }
              }
  
              return n;
          }
      }
docs: Read characters into a portion of an array.  Whenever a <a
  href="#lt">line terminator</a> is read the current line number is
  incremented.
  
  @param  cbuf
  Destination buffer
  
  @param  off
  Offset at which to start storing characters
  
  @param  len
  Maximum number of characters to read
  
  @return  The number of bytes read, or -1 if the end of the stream has
  already been reached
  
  @throws  IOException
  If an I/O error occurs