JDK-4529325 - Java Issue Tracker
Nov 19, 2001 ... ... String[] args) { boolean nowrap = true; if (args.length == 1 && args[0].equals("-h")) nowrap = false; try { Client client = new Client ...
Nov 19, 2001 ... ... String[] args) { boolean nowrap = true; if (args.length == 1 && args[0].equals("-h")) nowrap = false; try { Client client = new Client ...
JDK-6354964 - XMLReader implementation (Parser2) Should Not Close InputStream.CUSTOMER SUBMITTED WORKAROUND : Wrap input stream into custom classes to control time of calling the method close() and to catch its exceptions.
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.