code: public static VersionInfo getInstance(String version)
      {
          int length  = version.length();
          int array[] = {0, 0, 0, 0};
          int count   = 0;
          int index   = 0;
  
          while (count < 4 && index < length) {
              char c = version.charAt(index);
              if (c == '.') {
                  count ++;
              }
              else {
                  c -= '0';
                  if (c < 0 || c > 9) {
                      throw new IllegalArgumentException(INVALID_VERSION_NUMBER_);
                  }
                  array[count] *= 10;
                  array[count] += c;
              }
              index ++;
          }
          if (index != length) {
              throw new IllegalArgumentException(
                                                 "Invalid version number: String '" + version + "' exceeds version format");
          }
          for (int i = 0; i < 4; i ++) {
              if (array[i] < 0 || array[i] > 255) {
                  throw new IllegalArgumentException(INVALID_VERSION_NUMBER_);
              }
          }
  
          return getInstance(array[0], array[1], array[2], array[3]);
      }
docs: Returns an instance of VersionInfo with the argument version.
  @param version version String in the format of "major.minor.milli.micro"
  or "major.minor.milli" or "major.minor" or "major",
  where major, minor, milli, micro are non-negative numbers
  &lt;= 255. If the trailing version numbers are
  not specified they are taken as 0s. E.g. Version "3.1" is
  equivalent to "3.1.0.0".
  @return an instance of VersionInfo with the argument version.
  @exception IllegalArgumentException when the argument version
  is not in the right format