org.xml.sax.SAXParseException: Premature end of file.

hi im getting org.xml.sax.SAXParseException: Premature end of file. with following code

public void parseURI(InputStream inStream) {

inStream = new DataInputStream(inStream);

if (inStream != null) {

log.doDebugLogging("inStream available !!!");

} else {

log.doDebugLogging("inStream null !!!");

}

InputSource inSrc = new InputSource();

XMLReader xmlReader = null;

try {

SAXParserFactory spf = SAXParserFactory.newInstance();

spf.setValidating(false);

SAXParser sparser = spf.newSAXParser();

xmlReader = sparser.getXMLReader();

} catch (Exception ex) {

log.doErrorLogging("Error parseURI() creating SAXParserFactory / SAX Parser / XMLReader");

ex.printStackTrace();

}

xmlReader.setContentHandler(this);

try {

inSrc.setEncoding("UTF-8");

inSrc.setByteStream(inStream);

xmlReader.parse(inSrc);

} catch (Exception e2) {

log.doErrorLogging("Parsing Error parseURI() ");

e2.printStackTrace();

}

[1065 byte] By [dan1234a] at [2007-11-27 11:41:29]
# 1

That message is pretty clear, isn't it? The input stream ended before the end of the document. So you only got a partial document.

DrClapa at 2007-7-29 17:38:25 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 2

oh the message is clear ..but actually we are getting full document ,the stream is not ending before the end of document..if we convert tht Input stream into a string and then parse , it parse correctly

dan1234a at 2007-7-29 17:38:25 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...