Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8225763

Inflater and Deflater should implement AutoCloseable

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • 25
    • None
    • core-libs

      The Inflater and Deflater classes require the caller to call end() after use, because these objects retain references to native memory. This is clearly documented. However, there is no way to use these classes with the try-with-resources statement, because they don't implement AutoCloseable.

      These classes should implement a close() method that simply calls end(), and the classes should be retrofitted to implement AutoCloseable.

            jpai Jaikiran Pai
            smarks Stuart Marks
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: