adhoc/Base conversion/Java