You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by GitBox <gi...@apache.org> on 2021/02/20 02:07:24 UTC

[GitHub] [commons-compress] PeterAlfredLee commented on a change in pull request #168: COMPRESS-566 allow gzip buffer size to be configured

PeterAlfredLee commented on a change in pull request #168:
URL: https://github.com/apache/commons-compress/pull/168#discussion_r579572525



##########
File path: src/main/java/org/apache/commons/compress/compressors/gzip/GzipParameters.java
##########
@@ -118,4 +120,28 @@ public int getOperatingSystem() {
     public void setOperatingSystem(final int operatingSystem) {
         this.operatingSystem = operatingSystem;
     }
+
+    /**
+     * Gets size of the buffer used to retrieve compressed data.
+     * @return The size of the buffer used to retrieve compressed data.
+     * @since 1.21
+     * @see #setBufferSize(int)
+     */
+    public int getBufferSize() {
+        return this.bufferSize;
+    }
+
+    /**
+     * Sets size of the buffer used to retrieve compressed data from
+     * {@link Deflater} and write to underlying {@link OutputStream}.
+     * 
+     * @param bufferSize the bufferSize to set. Must be a positive value.
+     * @since 1.21
+     */
+    public void setBufferSize(int bufferSize) {
+        if (bufferSize <= 0) {

Review comment:
       Do we need a high limit check for `bufferSize` here?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org