I am trying to do bits padding to a byte array, and the number of bits that I need to pad is 48 (so 6 bytes). Below is the binary string:
String paddingBinaryString = "100000000000000000000000000000000000000000000000"
However, the byte array from this binary string shows the length to be 7 (instead of 6!). The way I convert the 48-bit binary String to byte array is:
byte[] paddingByteArr = new BigInteger(paddingBinaryString, 2).toByteArray();
System.out.println("paddingByteArr.length: " + paddingByteArr.length); //shows 7
There must be something obviously wrong, because 48 bits must be 6 bytes, not 7, right?