Broker document size

Hi, can anyone tell me how we can find the size of a document which is published on the broker, knowing the attributes of the document.

You can write a java service that converts the document (not including the _env) to Object to byte array and then calculates the size.