How to calculate the data length

Dear All,

Could you help to offer one thread to calculate the data length no matter it is a Stirng, Byte, or Stream(In other words, it is an object)?

Or a method to get TN bizdoc content length, I did not find any built-in service to get it.

Thanks a lot.

Best Regards,

Are you not getting the length details in BizDocEnvelope/ContentParts[0]/Length field?

Please try to send us your exact requirement so that we can share some ideas for that.

if you are trying to calculate the file length before submitting to TN … i would suggest to create a java service.


OK, I will try to descripe the requirement more clearly.
I need get to the data length of transaction for charging my customer.

First, for TN document we can get the length of bizdoc.

Second, we have several solution which did not go through TN, I expect one solution to get the length of this type of case.Maybe I need a java service which has an object data type as input, and the output should be the length of the object. Because I have no experience to develop this Java service, I need some help from the forum.

Thanks a lot if you guys can give me a favor.:smiley: