private static int estimateOutputLength(int inputLength, int sourceBase, int targetBase) {
    return (int)Math.ceil((Math.log(sourceBase) / Math.log(targetBase)) * inputLength);
  }
private static int estimateOutputLength(int inputLength, int sourceBase, int targetBase)