📄 ascii.java
字号:
package servlet.util;
public class Ascii
{
public static int toUpper(int i)
{
return toUpper[i & 0xff] & 0xff;
}
public static int toLower(int i)
{
return toLower[i & 0xff] & 0xff;
}
public static boolean isAlpha(int i)
{
return isAlpha[i & 0xff];
}
public static boolean isUpper(int i)
{
return isUpper[i & 0xff];
}
public static boolean isLower(int i)
{
return isLower[i & 0xff];
}
public static boolean isWhite(int i)
{
return isWhite[i & 0xff];
}
public static boolean isDigit(int i)
{
return isDigit[i & 0xff];
}
public static int parseInt(byte abyte0[], int i, int j)
throws NumberFormatException
{
byte byte0;
if(abyte0 == null || j <= 0 || !isDigit(byte0 = abyte0[i++]))
throw new NumberFormatException();
int k;
for(k = byte0 - 48; --j > 0; k = (k * 10 + byte0) - 48)
if(!isDigit(byte0 = abyte0[i++]))
throw new NumberFormatException();
return k;
}
public Ascii()
{
}
private static final byte toUpper[];
private static final byte toLower[];
private static final boolean isAlpha[];
private static final boolean isUpper[];
private static final boolean isLower[];
private static final boolean isWhite[];
private static final boolean isDigit[];
static
{
toUpper = new byte[256];
toLower = new byte[256];
isAlpha = new boolean[256];
isUpper = new boolean[256];
isLower = new boolean[256];
isWhite = new boolean[256];
isDigit = new boolean[256];
for(int i = 0; i < 256; i++)
{
toUpper[i] = (byte)i;
toLower[i] = (byte)i;
}
for(int j = 97; j <= 122; j++)
{
int k = (j + 65) - 97;
toUpper[j] = (byte)k;
toLower[k] = (byte)j;
isAlpha[j] = true;
isAlpha[k] = true;
isLower[j] = true;
isUpper[k] = true;
}
isWhite[32] = true;
isWhite[9] = true;
isWhite[13] = true;
isWhite[10] = true;
isWhite[12] = true;
isWhite[8] = true;
for(int l = 48; l <= 57; l++)
isDigit[l] = true;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -