3breadt / dd-plist

A java library providing support for ASCII, XML and binary property lists.
Other
258 stars 94 forks source link

PropertyListParser.parse(InputStream) closes InputStream for TYPE_XML #55

Closed kaibolay closed 4 years ago

kaibolay commented 4 years ago

The method PropertyListParser.parse(InputStream) is documented as

Parses a property list from an InputStream. This method does not close the specified input stream.

Unfortunately the underlying Xerxes XML parser does close the InputStream.

As a workaround I wrap the InputStream to ignore close():

      PropertyListParser.parse(
          new FilterInputStream(inputStream) {
            @Override public void close() {}
          });

I see two ways to fix this bug:

  1. Update the documentation to point out that the InputStream might be closed.
  2. Update the implementation to wrap the InputStream to ignore close().