code: public String readLine() throws IOException {
  
          ensureOpen();
  
          StringBuilder sb = null;
  
          start = tempStart;
  
          firstRead = true;
  
          while (true) {
  
              tempLen = 0;
              ok = false;
  
              readString();
              // if (tempLen != 0)
              // System.out.println(new String(cb, tempOffe, tempLen));
  
              if (!isRead && (tempLen == 0 || len == 0)) {
                  if (sb != null) {
                      return sb.toString();
                  }
                  return null;
              }
  
              if (!isRead) { // 如果不是需要读状态，那么返回
                  tempStart += tempLen;
                  if (sb == null) {
                      return new String(cb, tempOffe, tempLen);
                  } else {
                      sb.append(cb, tempOffe, tempLen);
                      return sb.toString();
                  }
              }
  
              if (tempLen == 0) {
                  continue;
              }
  
              // 如果是需要读状态那么读取
              if (sb == null) {
                  sb = new StringBuilder();
              }
              sb.append(cb, tempOffe, tempLen);
              tempStart += tempLen;
          }
  
      }
docs: 读取一行数据。ps 读取结果会忽略 \n \r