本文整理了Java中org.glassfish.grizzly.http.util.Ascii.isDigit()
方法的一些代码示例,展示了Ascii.isDigit()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Ascii.isDigit()
方法的具体详情如下:
包路径:org.glassfish.grizzly.http.util.Ascii
类名称: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;
}
内容来源于网络,如有侵权,请联系作者删除!