else if ('0' < aChar && aChar <= '9' && '0' < bChar && bChar <= '9') { int aInteger = aIn.readInt(aChar); int bInteger = bIn.readInt(bChar);  if (aInteger > bInteger) return 1; else if (aInteger < bInteger) return -1; else { aChar = aIn.read(); bChar = bIn.read(); } }
  private static int naturalOrderCompare(UnicodeValue a,                                         UnicodeValue b,                                         boolean ignoreCase)  {    SimpleStringReader aIn = new SimpleStringReader(a);    SimpleStringReader bIn = new SimpleStringReader(b);        int aChar = aIn.read();    int bChar = bIn.read();        if (aChar == -1 && bChar >= 0)      return -1;    else if (aChar >= 0 && bChar == -1)      return 1;    while (true) {      while (Character.isWhitespace(aChar)) {        aChar = aIn.read();      }      while (Character.isWhitespace(bChar)) {        bChar = bIn.read();      }      if (aChar == -1 && bChar == -1) {        return 0;      }      // leading zeros      // '01' < '2'      // '0a' > 'a'      if (aChar == '0' && bChar == '0') {        while (true) {          aChar = aIn.read();          bChar = bIn.read();                      if (aChar == '0' && bChar == '0') {            continue;          }          else if (aChar == '0') {            if ('1' <= bChar && bChar <= '9')              return -1;            else              return 1;          }          else if (bChar == 0) {            if ('1' <= aChar && aChar <= '9')              return 1;            else              return -1;          }          else {            break;          }        }      }      if (ignoreCase) {        aChar = Character.toUpperCase(aChar);        bChar = Character.toUpperCase(bChar);      }      if (aChar > bChar)        return 1;      else if (aChar < bChar)        return -1;      aChar = aIn.read();      bChar = bIn.read();      // trailing spaces      // "abc " > "abc"      if (aChar >= 0 && bChar == -1)        return 1;      else if (aChar == -1 && bChar >= 0)        return -1;    }  }