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

Deflater/Inflater simple usage methods

XMLWordPrintable

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

      Deflater and Inflater are hard to use correctly, resulting in wrapping code in external libraries and frequent misuse/bugs.

      What is needed in most cases is a simple pair of static compress/uncompress methods.

      byte[] Deflater.deflate(byte[] uncompressedData)
      byte[] Inflater.inflate(byte[] compressedData)

      I believe it would be worthwhile adding one override:

      byte[] Deflater.deflate(byte[] uncompressedData, int compressionLevel)

      Providing these methods would probably deal with 80%+ of end user usages of these classes.

            sherman Xueming Shen
            scolebourne Stephen Colebourne
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: