How can i get the size of an Document object?
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();
InputStream iStr = urlConnection.getInputStream();
doc = db.parse(iStr);
???? --> Log.i("Bytes",String.valueOf(doc.get????));
One way to implement this would be to write a custom subclass of FilterInputStream that counts the bytes that are read from the stream. (The class would be analogous to LineNumberInputStream …)
Then wrap the URL stream with your filter:
Finally when you are done reading/parsing the stream, call some method on your filter object to fetch the byte count.