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

EOU: Purpose of "size" param is not clear in Deflater/GZIPOutputStream ()

    XMLWordPrintable

Details

    • Bug
    • Resolution: Not an Issue
    • P4
    • None
    • 1.4.0
    • core-libs

    Description



      Name: rmT116609 Date: 02/06/2002


      FULL PRODUCT VERSION :
      java version "1.4.0-rc"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-rc-b91)
      Java HotSpot(TM) Client VM (build 1.4.0-rc-b91, mixed mode)

      A DESCRIPTION OF THE PROBLEM :
      The documentation for the "size" parameter for the constructor of both java.util.zip.GZIPOutputStream and java.util.zip.DeflaterOutputStream is not clear. At first glance, it appears that good values are in the numbers of kilobytes and that it effectively obviates the need to have an underlying BufferedOutputStream.

      That is not the case. After source code inspection, I saw that the default value for GZIPOutputStream is only 512 and that's because this buffer is essentially flushed at least once on every call to a write() method. It seems to me that it is not worth configuring this parameter. At a minimum the parameter should be make it clear that using this OutputStream does not obviate the need for BufferedOutputStream and that the default value is just fine.
      (Review ID: 139109)
      ======================================================================

      Attachments

        Activity

          People

            sherman Xueming Shen
            rmandalasunw Ranjith Mandala (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: