[jdom-interest] How many bytes is my JDOM Document
mike at saxonica.com
Fri Aug 4 07:15:26 PDT 2006
Saying "should" and "must" doesn't make it true. I don't know why Java
doesn't provide this capability, but it doesn't.
In any case, you (the OP) don't want the number of bytes in the document
object, you want the number of bytes in all the objects in the tree.
Perhaps. Other people thought you wanted the number of bytes in its
serialization. I don't think we actually know what the requirement is,
perhaps someone will tell us.
There should be a way to count the bytes in a Java object without trying to
output it, I mean, the object is in memory as bytes, so there must be a way
to count them.
Outputting the file somewhere may enable to know the EXACT size of the
outputted file, but the object's size in memory should be accessible another
2006/8/4, Paul Libbrecht <paul at activemath.org>:
Print it to a stream that only counts but otherwise discards ? It's easy
to write such a stream... just subclass outputstream.write(byte) and
maybe .write(byte,start,len) and count...
I don't think there's a way without outputting.
Søren Faltz wrote:
> I want to find out how many bytes my document is.
> An easy way would be to stream the document to disk, and then call
> but is there any way to find out without saving the document to disk
To control your jdom-interest membership:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the jdom-interest