let say we have the following function in solidity:
function tryAbiEncode (address _address, uint8 _amount) public pure returns (bytes memory)
{
return abi.encode("\x19Ethereum Signed Message:\n",_address, _amount);
}
If I executed the above function with the following parameters:
_address = 0xbfF89Fe7598f162ACC86CfC3267Eb132F69B7e2B
_amount = 10
I will get the below result:
0x0000000000000000000000000000000000000000000000000000000000000060000000000000000000000000bff89fe7598f162acc86cfc3267eb132f69b7e2b000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000001a19457468657265756d205369676e6564204d6573736167653a0a000000000000
My question is, how I can get the same results but in Java using web3j library ? I mean how I can execute abi.encode
but in Java ?
Thanks!