JDK-4291371 - Java Issue Tracker
Nov 14, 1999 ... ... zero. The looping code is actually in the InputStreamReader.fill() method. The first call to the stream's read(byte[]) method returns zero.
Nov 14, 1999 ... ... zero. The looping code is actually in the InputStreamReader.fill() method. The first call to the stream's read(byte[]) method returns zero.
The stream is already consumed when the second getInputStream() is executed. So I'm forced to write the stream to a temporary file (because it may not fit in a memory resident ByteArrayInputStream), and return a new InputStream object each time.
JDK-6354964 - XMLReader implementation (Parser2) Should Not Close InputStream.A DESCRIPTION OF THE PROBLEM : XMLEventReader closes underlying input source just during process of parsing XML. This is unexpected and leads to undesirable effects.