Image

Why can't InputStreams and OutputStreams be easier to manage?

I want to create an OutputStream to the same place that I got my InputStream from.

Why is this so difficult?

It's an xml file on the classpath that I'm loading into an InputStream.

I later have to write back out to that same xml file.

Should have been simple. It was until I had to package everything into a jar file, at which point everything exploded (was using File objects loaded from the path indicated by this.class.getResource("filename") - consider that part pseudocode.

Anyway.

Ideas? I can't figure out how to get a FileOutputStream, when all I have is an InputStream (apparently a ByteArrayInputStream) to a file that's loaded via classpath.

[Edit - found the actual problem due to a comment below. So...when the problem changes, change the environment. We reworked the solution to not require the output of information to a file.]