[jdom-interest] How many bytes is my JDOM Document
soren.faltz at gmail.com
Tue Aug 8 03:09:15 PDT 2006
I am determing the size this way
s = convertDocumentToString(doc);
ByteArrayOutputStream bout = new ByteArrayOutputStream();
ObjectOutputStream objOut = new ObjectOutputStream(bout);
contentLength = bout.size();
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
> > File.size()
> > but is there any way to find out without saving the document to disk
> > first??
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the jdom-interest