org.apache.tomcat.util.buf.Ascii.isDigit()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(9.5k)|赞(0)|评价(0)|浏览(92)

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

Ascii.isDigit介绍

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

代码示例

代码示例来源:origin: org.apache.coyote.springsource/com.springsource.org.apache.coyote.springsource

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: jboss.web/jbossweb

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.jboss.web/jbossweb

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: com.ovea.tajin.server/tajin-server-tomcat7

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.jboss.web/jbossweb

/**
 * Parses an unsigned integer from the specified subarray of bytes.
 * @param b the bytes to parse
 * @param off the start offset of the bytes
 * @param len the length of the bytes
 * @exception NumberFormatException if the integer format was invalid
 */
public static int parseInt(byte[] 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.apache.coyote.springsource/com.springsource.org.apache.coyote.springsource

/**
 * Parses an unsigned integer from the specified subarray of bytes.
 * @param b the bytes to parse
 * @param off the start offset of the bytes
 * @param len the length of the bytes
 * @exception NumberFormatException if the integer format was invalid
 */
public static int parseInt(byte[] 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: com.ovea.tajin.server/tajin-server-tomcat7

/**
 * Parses an unsigned integer from the specified subarray of bytes.
 * @param b the bytes to parse
 * @param off the start offset of the bytes
 * @param len the length of the bytes
 * @exception NumberFormatException if the integer format was invalid
 */
public static int parseInt(byte[] 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: jboss.web/jbossweb

/**
 * Parses an unsigned integer from the specified subarray of bytes.
 * @param b the bytes to parse
 * @param off the start offset of the bytes
 * @param len the length of the bytes
 * @exception NumberFormatException if the integer format was invalid
 */
public static int parseInt(byte[] 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.apache.coyote/com.springsource.org.apache.coyote

/**
 * @deprecated Unused. Will be removed in Tomcat 8.0.x onwards.
 */
@Deprecated
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.jboss.web/jbossweb

/**
 * Parses an unsigned long from the specified subarray of bytes.
 * @param b the bytes to parse
 * @param off the start offset of the bytes
 * @param len the length of the bytes
 * @exception NumberFormatException if the long format was invalid
 */
public static long parseLong(byte[] 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 < OVERFLOW_LIMIT || (n == OVERFLOW_LIMIT && (c - '0') < 8))) {
      n = n * 10 + c - '0';
    } else {
      throw new NumberFormatException();
    }
  }
  return n;
}

代码示例来源:origin: org.apache.geronimo.ext.tomcat/util

/**
 * @deprecated Unused. Will be removed in Tomcat 8.0.x onwards.
 */
@Deprecated
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.ops4j.pax.tipi/org.ops4j.pax.tipi.tomcat-embed-core

/**
   * Parses an unsigned long from the specified subarray of bytes.
   * @param b the bytes to parse
   * @param off the start offset of the bytes
   * @param len the length of the bytes
   * @return the long value
   * @exception NumberFormatException if the long format was invalid
   */
  public static long parseLong(byte[] 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 < OVERFLOW_LIMIT || (n == OVERFLOW_LIMIT && (c - '0') < 8))) {
        n = n * 10 + c - '0';
      } else {
        throw new NumberFormatException();
      }
    }

    return n;
  }
}

代码示例来源:origin: org.jboss.web/jbossweb

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';
  long m;
  while (--len > 0) {
    if (!isDigit(c = b[off++])) {
      throw new NumberFormatException();
    }
    m = n * 10 + c - '0';
    if (m < n) {
      // Overflow
      throw new NumberFormatException();
    } else {
      n = m;
    }
  }
  return n;
}

代码示例来源:origin: com.ovea.tajin.server/tajin-server-tomcat7

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';
  long m;
  while (--len > 0) {
    if (!isDigit(c = b[off++])) {
      throw new NumberFormatException();
    }
    m = n * 10 + c - '0';
    if (m < n) {
      // Overflow
      throw new NumberFormatException();
    } else {
      n = m;
    }
  }
  return n;
}

代码示例来源:origin: jboss.web/jbossweb

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';
  long m;
  while (--len > 0) {
    if (!isDigit(c = b[off++])) {
      throw new NumberFormatException();
    }
    m = n * 10 + c - '0';
    if (m < n) {
      // Overflow
      throw new NumberFormatException();
    } else {
      n = m;
    }
  }
  return n;
}

代码示例来源:origin: org.apache.coyote.springsource/com.springsource.org.apache.coyote.springsource

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';
  long m;
  while (--len > 0) {
    if (!isDigit(c = b[off++])) {
      throw new NumberFormatException();
    }
    m = n * 10 + c - '0';
    if (m < n) {
      // Overflow
      throw new NumberFormatException();
    } else {
      n = m;
    }
  }
  return n;
}

代码示例来源:origin: org.apache.geronimo.ext.tomcat/util

/**
 * Parses an unsigned integer from the specified subarray of bytes.
 * @param b the bytes to parse
 * @param off the start offset of the bytes
 * @param len the length of the bytes
 * @exception NumberFormatException if the integer format was invalid
 * @deprecated Unused. Will be removed in Tomcat 8.0.x onwards.
 */
@Deprecated
public static int parseInt(byte[] 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.apache.coyote/com.springsource.org.apache.coyote

/**
 * Parses an unsigned integer from the specified subarray of bytes.
 * @param b the bytes to parse
 * @param off the start offset of the bytes
 * @param len the length of the bytes
 * @exception NumberFormatException if the integer format was invalid
 * @deprecated Unused. Will be removed in Tomcat 8.0.x onwards.
 */
@Deprecated
public static int parseInt(byte[] 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.apache.coyote/com.springsource.org.apache.coyote

/**
 * @deprecated Unused. Will be removed in Tomcat 8.0.x onwards.
 */
@Deprecated
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';
  long m;
  while (--len > 0) {
    if (!isDigit(c = b[off++])) {
      throw new NumberFormatException();
    }
    m = n * 10 + c - '0';
    if (m < n) {
      // Overflow
      throw new NumberFormatException();
    } else {
      n = m;
    }
  }
  return n;
}

代码示例来源:origin: org.apache.geronimo.ext.tomcat/util

/**
 * @deprecated Unused. Will be removed in Tomcat 8.0.x onwards.
 */
@Deprecated
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';
  long m;
  while (--len > 0) {
    if (!isDigit(c = b[off++])) {
      throw new NumberFormatException();
    }
    m = n * 10 + c - '0';
    if (m < n) {
      // Overflow
      throw new NumberFormatException();
    } else {
      n = m;
    }
  }
  return n;
}

相关文章