BigInteger.toString(radix)
will do what you want. Just pass in a radix of 2.
static String hexToBin(String s) {
return new BigInteger(s, 16).toString(2);
}
More Related Contents:
- Java: Syntax and meaning behind “[B@1ef9157”? Binary/Address?
- Convert A String (like testing123) To Binary In Java [closed]
- How to determine if a number is binary and has an even amount of zeros with only one regex?
- Printing Binary values using nested loops [closed]
- The main thing is: how that binary for example 11110000 is divided into two parts such as s1=1111 and s2=0000. I have to do this in Java
- how to get the first two bytes from a string in java?
- How to convert a byte array to a hex string in Java?
- How to get 0-padded binary representation of an integer in java?
- In Java, how do I convert a byte array to a string of hex digits while keeping leading zeros? [duplicate]
- How do you embed binary data in XML?
- Convert hex string to int
- Hexadecimal to Integer in Java
- Converting an int to a binary string representation in Java?
- Converting Decimal to Binary Java
- How to convert a byte to its binary string representation
- Parsing a Hexadecimal String to an Integer throws a NumberFormatException?
- In Java, can I define an integer constant in binary format?
- In Java, how do I convert a hex string to a byte[]? [duplicate]
- Convert binary string to byte array
- How to convert hex strings to byte values in Java
- How to convert byte array to hex format in Java
- Compare two Byte Arrays? (Java)
- Adding binary numbers
- Java Convert integer to hex integer
- Verify if String is hexadecimal
- Why is Java able to store 0xff000000 as an int?
- Determining binary/text file type in Java?
- Converting some hexadecimal string to a decimal integer
- How to convert hex string to float in Java?
- Compare two hex strings in Java?