There is no simple method in Java for finding that out. There are good reasons why you don't want to know. Java is a high-level language and the sizeof operator which is found in C was excluded. That is because its only use is for programmed memory allocation and deallocation, both potent sources of subtle and dangerous errors.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com