Constructor and Description |
---|
BitUtil() |
Modifier and Type | Method and Description |
---|---|
static byte |
clearBit(byte i,
int num) |
static char |
clearBit(char i,
int num) |
static int |
clearBit(int i,
int num) |
static long |
clearBit(long i,
int num) |
static short |
clearBit(short i,
int num) |
static boolean |
isBitSet(byte i,
int num)
returns true is specified bit in the specified byte is set.
|
static boolean |
isBitSet(char i,
int num) |
static boolean |
isBitSet(int i,
int num) |
static boolean |
isBitSet(long i,
int num) |
static boolean |
isBitSet(short i,
int num) |
static void |
main(String[] args) |
static byte |
setBit(byte i,
int num) |
static char |
setBit(char i,
int num) |
static int |
setBit(int i,
int num) |
static long |
setBit(long i,
long num) |
static short |
setBit(short i,
int num) |
static String |
toBinaryString(byte i) |
static String |
toBinaryString(byte i,
String format)
returns a 8 char binary digit string.
|
static String |
toBinaryString(char i)
returns a 16 char binary digit string
|
static String |
toBinaryString(char i,
String format)
returns a 16 char binary digit string.
|
static String |
toBinaryString(int i)
returns a 32 char binary digit string (Integer.toBinaryString is not padded, can be less than 32
chars)
|
static String |
toBinaryString(int i,
String format)
returns a 32char binary digit string (Long.toBinaryString is not padded, can be less than
32 chars).
|
static String |
toBinaryString(long i)
returns a 64 char binary digit string (Long.toBinaryString is not padded, can be less than 64
chars))
|
static String |
toBinaryString(long i,
String format)
returns a 64 char binary digit string (Long.toBinaryString is not padded, can be less than
64 chars).
|
static String |
toBinaryString(short i)
returns a 16 char binary digit string
|
static String |
toBinaryString(short i,
String format)
returns a 16 char binary digit string.
|
public BitUtil()
public static boolean isBitSet(byte i, int num)
Runtime
public static boolean isBitSet(short i, int num)
public static boolean isBitSet(char i, int num)
public static boolean isBitSet(int i, int num)
public static boolean isBitSet(long i, int num)
public static byte setBit(byte i, int num)
public static short setBit(short i, int num)
public static char setBit(char i, int num)
public static int setBit(int i, int num)
public static long setBit(long i, long num)
public static byte clearBit(byte i, int num)
public static short clearBit(short i, int num)
public static char clearBit(char i, int num)
public static int clearBit(int i, int num)
public static long clearBit(long i, int num)
public static String toBinaryString(byte i)
public static String toBinaryString(short i)
public static String toBinaryString(char i)
public static String toBinaryString(int i)
public static String toBinaryString(long i)
public static String toBinaryString(byte i, String format)
The format string has a number and separator, like "4 " which will print chunks of size
public static String toBinaryString(short i, String format)
The format string has a number and separator, like "4 " which will print chunks of size
public static String toBinaryString(char i, String format)
The format string has a number and separator, like "4 " which will print chunks of size num with the specified separator.
public static String toBinaryString(int i, String format)
The format string has a number and separator, like "4 " which will print chunks of size
public static String toBinaryString(long i, String format)
The format string has a number and separator, like "4 " which will print chunks of size