public byte[] convertToByte(BigInteger bigInteger, int pad) {
      String bigIntegerString = bigInteger.toString(radix);
      bigIntegerString = StringUtils.leftPad(bigIntegerString, pad, '0');
      return Bytes.toBytes(bigIntegerString);
    }
Returns the bytes corresponding to the BigInteger
@param bigInteger number to convert
@param pad        padding length
@return byte corresponding to input BigInteger
hbase-server/src/main/java/org/apache/hadoop/hbase/util/RegionSplitter.java