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

DeflaterOutputStream should explain responsibility for freeing resources

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P5 P5
    • None
    • None
    • core-libs
    • None

      java.util.zip.DeflaterOutputStream will only call Deflater#end() if it uses a default Deflater instance (i.e. one it created itself). This means that users of the DeflaterOutputStream constructors taking a Deflater parameter have to call Deflater#end() explicitly if they want resources to be freed before garbage collection.

      While this makes sense it should be mentioned in the JavaDoc for DeflaterOutputStream, probably in the documentation for the constructors taking a Deflater parameter.

            sherman Xueming Shen
            hannesw Hannes Wallnoefer
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: