<div>I am determing the size this way</div>
<div> </div>
<div>
<p>String s;<br> int contentLength=0;</p>
<p> try {<br> s = convertDocumentToString(doc);<br> <br> ByteArrayOutputStream bout = new ByteArrayOutputStream();<br> ObjectOutputStream objOut = new ObjectOutputStream(bout);<br> <br> objOut.writeObject
(s);<br> contentLength = bout.size();</p>
<p> objOut.flush();<br> bout.flush(); </p><br><br> </div>
<div><span class="gmail_quote">2006/8/4, Paul Libbrecht <<a href="mailto:paul@activemath.org">paul@activemath.org</a>>:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Print it to a stream that only counts but otherwise discards ? It's easy<br>to write such a stream... just subclass
outputstream.write(byte) and<br>maybe .write(byte[],start,len) and count...<br><br>I don't think there's a way without outputting.<br><br>paul<br><br>Søren Faltz wrote:<br>> I want to find out how many bytes my document is.
<br>> An easy way would be to stream the document to disk, and then call<br>> File.size()<br>> but is there any way to find out without saving the document to disk<br>> first??<br><br><br><br></blockquote></div>
<br>