org.glassfish.grizzly.http.util.Ascii.isDigit()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(7.5k)|赞(0)|评价(0)|浏览(107)

本文整理了Java中org.glassfish.grizzly.http.util.Ascii.isDigit()方法的一些代码示例,展示了Ascii.isDigit()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Ascii.isDigit()方法的具体详情如下:
包路径:org.glassfish.grizzly.http.util.Ascii
类名称:Ascii
方法名:isDigit

Ascii.isDigit介绍

[英]Returns true if the specified ASCII character is a digit.
[中]如果指定的ASCII字符是数字,则返回true。

代码示例

代码示例来源:origin: org.glassfish.grizzly/grizzly-http

public static int parseInt(char[] b, int off, int len)
    throws NumberFormatException {
  int c;
  if (b == null || len <= 0 || !isDigit(c = b[off++])) {
    throw new NumberFormatException();
  }
  int n = c - '0';
  while (--len > 0) {
    if (!isDigit(c = b[off++])) {
      throw new NumberFormatException();
    }
    n = n * 10 + c - '0';
  }
  return n;
}

代码示例来源:origin: javaee/grizzly

public static int parseInt(char[] b, int off, int len)
    throws NumberFormatException {
  int c;
  if (b == null || len <= 0 || !isDigit(c = b[off++])) {
    throw new NumberFormatException();
  }
  int n = c - '0';
  while (--len > 0) {
    if (!isDigit(c = b[off++])) {
      throw new NumberFormatException();
    }
    n = n * 10 + c - '0';
  }
  return n;
}

代码示例来源:origin: javaee/grizzly

public static int parseInt(char[] b, int off, int len)
    throws NumberFormatException {
  int c;
  if (b == null || len <= 0 || !isDigit(c = b[off++])) {
    throw new NumberFormatException();
  }
  int n = c - '0';
  while (--len > 0) {
    if (!isDigit(c = b[off++])) {
      throw new NumberFormatException();
    }
    n = n * 10 + c - '0';
  }
  return n;
}

代码示例来源:origin: javaee/grizzly

public static int parseInt(char[] b, int off, int len)
    throws NumberFormatException {
  int c;
  if (b == null || len <= 0 || !isDigit(c = b[off++])) {
    throw new NumberFormatException();
  }
  int n = c - '0';
  while (--len > 0) {
    if (!isDigit(c = b[off++])) {
      throw new NumberFormatException();
    }
    n = n * 10 + c - '0';
  }
  return n;
}

代码示例来源:origin: javaee/grizzly

public static int parseInt(char[] b, int off, int len)
    throws NumberFormatException {
  int c;
  if (b == null || len <= 0 || !isDigit(c = b[off++])) {
    throw new NumberFormatException();
  }
  int n = c - '0';
  while (--len > 0) {
    if (!isDigit(c = b[off++])) {
      throw new NumberFormatException();
    }
    n = n * 10 + c - '0';
  }
  return n;
}

代码示例来源:origin: javaee/grizzly

public static int parseInt(char[] b, int off, int len)
    throws NumberFormatException {
  int c;
  if (b == null || len <= 0 || !isDigit(c = b[off++])) {
    throw new NumberFormatException();
  }
  int n = c - '0';
  while (--len > 0) {
    if (!isDigit(c = b[off++])) {
      throw new NumberFormatException();
    }
    n = n * 10 + c - '0';
  }
  return n;
}

代码示例来源:origin: javaee/grizzly

public static int parseInt(char[] b, int off, int len)
    throws NumberFormatException {
  int c;
  if (b == null || len <= 0 || !isDigit(c = b[off++])) {
    throw new NumberFormatException();
  }
  int n = c - '0';
  while (--len > 0) {
    if (!isDigit(c = b[off++])) {
      throw new NumberFormatException();
    }
    n = n * 10 + c - '0';
  }
  return n;
}

代码示例来源:origin: javaee/grizzly

public static int parseInt(char[] b, int off, int len)
    throws NumberFormatException {
  int c;
  if (b == null || len <= 0 || !isDigit(c = b[off++])) {
    throw new NumberFormatException();
  }
  int n = c - '0';
  while (--len > 0) {
    if (!isDigit(c = b[off++])) {
      throw new NumberFormatException();
    }
    n = n * 10 + c - '0';
  }
  return n;
}

代码示例来源:origin: org.glassfish.grizzly/grizzly-websockets-server

public static int parseInt(char[] b, int off, int len)
    throws NumberFormatException {
  int c;
  if (b == null || len <= 0 || !isDigit(c = b[off++])) {
    throw new NumberFormatException();
  }
  int n = c - '0';
  while (--len > 0) {
    if (!isDigit(c = b[off++])) {
      throw new NumberFormatException();
    }
    n = n * 10 + c - '0';
  }
  return n;
}

代码示例来源:origin: org.glassfish.grizzly/grizzly-http-server-core

public static int parseInt(char[] b, int off, int len)
    throws NumberFormatException {
  int c;
  if (b == null || len <= 0 || !isDigit(c = b[off++])) {
    throw new NumberFormatException();
  }
  int n = c - '0';
  while (--len > 0) {
    if (!isDigit(c = b[off++])) {
      throw new NumberFormatException();
    }
    n = n * 10 + c - '0';
  }
  return n;
}

代码示例来源:origin: javaee/grizzly

public static long parseLong(char[] b, int off, int len)
    throws NumberFormatException {
  int c;
  if (b == null || len <= 0 || !isDigit(c = b[off++])) {
    throw new NumberFormatException();
  }
  long n = c - '0';
  while (--len > 0) {
    if (isDigit(c = b[off++])
        && (n < LONG_OVERFLOW_LIMIT || (n == LONG_OVERFLOW_LIMIT && (c - '0') < 8))) {
      n = n * 10 + c - '0';
    } else {
      throw new NumberFormatException();
    }
  }
  return n;
}

代码示例来源:origin: org.glassfish.grizzly/grizzly-http-server-core

public static long parseLong(char[] b, int off, int len)
    throws NumberFormatException {
  int c;
  if (b == null || len <= 0 || !isDigit(c = b[off++])) {
    throw new NumberFormatException();
  }
  long n = c - '0';
  while (--len > 0) {
    if (isDigit(c = b[off++])
        && (n < LONG_OVERFLOW_LIMIT || (n == LONG_OVERFLOW_LIMIT && (c - '0') < 8))) {
      n = n * 10 + c - '0';
    } else {
      throw new NumberFormatException();
    }
  }
  return n;
}

代码示例来源:origin: org.glassfish.grizzly/grizzly-http

public static int parseInt(String s, int off, int len)
    throws NumberFormatException {
  int c;
  if (s == null || len <= 0 || !isDigit(c = s.charAt(off++))) {
    throw new NumberFormatException();
  }
  int n = c - '0';
  while (--len > 0) {
    if (isDigit(c = s.charAt(off++))
        && (n < INT_OVERFLOW_LIMIT || (n == INT_OVERFLOW_LIMIT && (c - '0') < 8))) {
      n = n * 10 + c - '0';
    } else {
      throw new NumberFormatException();
    }
  }
  return n;
}

代码示例来源:origin: org.glassfish.grizzly/grizzly-http

public static long parseLong(String s, int off, int len)
    throws NumberFormatException {
  int c;
  if (s == null || len <= 0 || !isDigit(c = s.charAt(off++))) {
    throw new NumberFormatException();
  }
  long n = c - '0';
  while (--len > 0) {
    if (isDigit(c = s.charAt(off++))
        && (n < LONG_OVERFLOW_LIMIT || (n == LONG_OVERFLOW_LIMIT && (c - '0') < 8))) {
      n = n * 10 + c - '0';
    } else {
      throw new NumberFormatException();
    }
  }
  return n;
}

代码示例来源:origin: org.glassfish.grizzly/grizzly-websockets-server

public static int parseInt(String s, int off, int len)
    throws NumberFormatException {
  int c;
  if (s == null || len <= 0 || !isDigit(c = s.charAt(off++))) {
    throw new NumberFormatException();
  }
  int n = c - '0';
  while (--len > 0) {
    if (isDigit(c = s.charAt(off++))
        && (n < INT_OVERFLOW_LIMIT || (n == INT_OVERFLOW_LIMIT && (c - '0') < 8))) {
      n = n * 10 + c - '0';
    } else {
      throw new NumberFormatException();
    }
  }
  return n;
}

代码示例来源:origin: javaee/grizzly

public static long parseLong(String s, int off, int len)
    throws NumberFormatException {
  int c;
  if (s == null || len <= 0 || !isDigit(c = s.charAt(off++))) {
    throw new NumberFormatException();
  }
  long n = c - '0';
  while (--len > 0) {
    if (isDigit(c = s.charAt(off++))
        && (n < LONG_OVERFLOW_LIMIT || (n == LONG_OVERFLOW_LIMIT && (c - '0') < 8))) {
      n = n * 10 + c - '0';
    } else {
      throw new NumberFormatException();
    }
  }
  return n;
}

代码示例来源:origin: javaee/grizzly

public static int parseInt(String s, int off, int len)
    throws NumberFormatException {
  int c;
  if (s == null || len <= 0 || !isDigit(c = s.charAt(off++))) {
    throw new NumberFormatException();
  }
  int n = c - '0';
  while (--len > 0) {
    if (isDigit(c = s.charAt(off++))
        && (n < INT_OVERFLOW_LIMIT || (n == INT_OVERFLOW_LIMIT && (c - '0') < 8))) {
      n = n * 10 + c - '0';
    } else {
      throw new NumberFormatException();
    }
  }
  return n;
}

代码示例来源:origin: javaee/grizzly

public static long parseLong(String s, int off, int len)
    throws NumberFormatException {
  int c;
  if (s == null || len <= 0 || !isDigit(c = s.charAt(off++))) {
    throw new NumberFormatException();
  }
  long n = c - '0';
  while (--len > 0) {
    if (isDigit(c = s.charAt(off++))
        && (n < LONG_OVERFLOW_LIMIT || (n == LONG_OVERFLOW_LIMIT && (c - '0') < 8))) {
      n = n * 10 + c - '0';
    } else {
      throw new NumberFormatException();
    }
  }
  return n;
}

代码示例来源:origin: javaee/grizzly

public static long parseLong(String s, int off, int len)
    throws NumberFormatException {
  int c;
  if (s == null || len <= 0 || !isDigit(c = s.charAt(off++))) {
    throw new NumberFormatException();
  }
  long n = c - '0';
  while (--len > 0) {
    if (isDigit(c = s.charAt(off++))
        && (n < LONG_OVERFLOW_LIMIT || (n == LONG_OVERFLOW_LIMIT && (c - '0') < 8))) {
      n = n * 10 + c - '0';
    } else {
      throw new NumberFormatException();
    }
  }
  return n;
}

代码示例来源:origin: org.glassfish.grizzly/grizzly-http-server-core

public static int parseInt(String s, int off, int len)
    throws NumberFormatException {
  int c;
  if (s == null || len <= 0 || !isDigit(c = s.charAt(off++))) {
    throw new NumberFormatException();
  }
  int n = c - '0';
  while (--len > 0) {
    if (isDigit(c = s.charAt(off++))
        && (n < INT_OVERFLOW_LIMIT || (n == INT_OVERFLOW_LIMIT && (c - '0') < 8))) {
      n = n * 10 + c - '0';
    } else {
      throw new NumberFormatException();
    }
  }
  return n;
}

相关文章