JDK-4291371 - Java Issue Tracker
Nov 14, 1999 ... ... 2 on Windows 98. I create an InputStreamReader() to read from a ... The looping code is actually in the InputStreamReader.fill() method.
Nov 14, 1999 ... ... 2 on Windows 98. I create an InputStreamReader() to read from a ... The looping code is actually in the InputStreamReader.fill() method.
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.
java -cp test.jar Test sun.net.www.protocol.jar.JarURLConnection$JarURLInputStream@1690726 -54 -2 -70 -66 0 0 0 50 minor 0 major 50 If a println is added, System.out.println(is.read(header)); instead of.
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.
I have now isolated the problem into a single piece of code for demonstration purposes. This is cut down from a larger piece of software which uses the Java Activation Framework (hence the use of InputStreams). I have attached the code, and two trivial HTML documents.
The looping code is actually in the InputStreamReader.fill() method.But the stream returned by CommPort.getInputStream() simply returns zero, without throwing an exception. The documentation for InputStream.read(byte[]) doesn't indicate that zero is an invalid value, though.