code: private static byte[] toBytes(Object input) {
          if (input instanceof byte[]) {
              return (byte[]) input;
          } else if (input instanceof String) {
              String inputString = (String) input;
              return inputString.getBytes();
          } else if (input instanceof Long) {
              Long inputLong = (Long) input;
              return (inputLong == 0) ? ByteUtil.EMPTY_BYTE_ARRAY : asUnsignedByteArray(BigInteger.valueOf(inputLong));
          } else if (input instanceof Integer) {
              Integer inputInt = (Integer) input;
              return (inputInt == 0) ? ByteUtil.EMPTY_BYTE_ARRAY : asUnsignedByteArray(BigInteger.valueOf(inputInt));
          } else if (input instanceof BigInteger) {
              BigInteger inputBigInt = (BigInteger) input;
              return (inputBigInt.equals(BigInteger.ZERO)) ? ByteUtil.EMPTY_BYTE_ARRAY : asUnsignedByteArray(inputBigInt);
          }
          throw new RuntimeException("Unsupported type: Only accepting String, Integer and BigInteger for now");
      }
docs: /*
  Utility function to convert Objects into byte arrays