我只是想知道为什么我的代码给我一个 NumberFormatException?
从堆栈溢出的其他帖子中,人们似乎对空格有问题,除了我的似乎根本没有这个问题。
package suop.space;
import java.util.BitSet;
public class ColourUtils {
public static short getAlpha(final int rgb) {
return (short) ((rgb >> 24) & 0xff);
}
public static short getRed(final int rgb) {
return (short) ((rgb & 0x00ff0000) >> 16);
}
public static short getGreen(final int rgb) {
return (short) ((rgb & 0x0000ff00) >> 8);
}
public static short getBlue(final int rgb) {
return (short) (rgb & 0x000000ff);
}
public static int getRGB(int alpha, int red, int green, int blue) …Run Code Online (Sandbox Code Playgroud)