Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 9C609200B8B for ; Tue, 4 Oct 2016 14:05:22 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 9AF28160ADC; Tue, 4 Oct 2016 12:05:22 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id E219E160AC5 for ; Tue, 4 Oct 2016 14:05:21 +0200 (CEST) Received: (qmail 38619 invoked by uid 500); 4 Oct 2016 12:05:21 -0000 Mailing-List: contact issues-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list issues@camel.apache.org Received: (qmail 38596 invoked by uid 99); 4 Oct 2016 12:05:21 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Oct 2016 12:05:21 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 83FC52C2A69 for ; Tue, 4 Oct 2016 12:05:20 +0000 (UTC) Date: Tue, 4 Oct 2016 12:05:20 +0000 (UTC) From: "Franz Forsthofer (JIRA)" To: issues@camel.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CAMEL-10368) Unused deflater in ZipDataFormat MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Tue, 04 Oct 2016 12:05:22 -0000 [ https://issues.apache.org/jira/browse/CAMEL-10368?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15545175#comment-15545175 ] Franz Forsthofer commented on CAMEL-10368: ------------------------------------------ Hello Andrea, it is only a very small change. So I have committed. I hope this is no problem for you. Sorry for any inconvenience. > Unused deflater in ZipDataFormat > -------------------------------- > > Key: CAMEL-10368 > URL: https://issues.apache.org/jira/browse/CAMEL-10368 > Project: Camel > Issue Type: Bug > Components: camel-core > Reporter: Franz Forsthofer > Assignee: Franz Forsthofer > Fix For: 2.19.0, 2.17.4, 2.18.1 > > > In the ZipDataForamt class you find > final Deflater deflater = new Deflater(compressionLevel); > final DeflaterOutputStream zipOutput = new DeflaterOutputStream(stream, new Deflater(compressionLevel)); > try { > IOHelper.copy(is, zipOutput); > } finally { > IOHelper.close(is, zipOutput); > > /* > * As we create the Deflater our self and do not use the stream default > * (see {@link java.util.zip.DeflaterOutputStream#usesDefaultDeflater}) > * we need to close the Deflater to not risk a OutOfMemoryException > * in native code parts (see {@link java.util.zip.Deflater#end}) > */ > deflater.end(); > } > the deflater variable should be used in the DeflaterOutputStream > final DeflaterOutputStream zipOutput = new DeflaterOutputStream(stream, deflater); -- This message was sent by Atlassian JIRA (v6.3.4#6332)