How to get payload in Java

Sorry for reopen once more this old question, but I think it should actually be implemented directly into the API for URCap development.
(Payload and Center of Gravity)