I think you mean BigInteger here. BigDecimal uses a decimal representation for floating point values, so it is not suitable for processing bits.
BigInteger has left and right shift operations using .shiftLeft() and .shiftRight() for multiplications / divisions into two levels respectively, so you can use this.
It also has operations such as .bitCount() , .bitLength() .{clear,set}Bit() , .and() , .or() , .andNot() and some others. No bitwise, however, as that makes no sense.
source share