activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dej...@apache.org
Subject svn commit: r997290 - /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQBytesMessage.java
Date Wed, 15 Sep 2010 11:38:27 GMT
Author: dejanb
Date: Wed Sep 15 11:38:27 2010
New Revision: 997290

URL: http://svn.apache.org/viewvc?rev=997290&view=rev
Log:
https://issues.apache.org/activemq/browse/AMQ-2919 - Deflater.end() should be called from
ActiveMQBytesMessage

Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQBytesMessage.java

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQBytesMessage.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQBytesMessage.java?rev=997290&r1=997289&r2=997290&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQBytesMessage.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQBytesMessage.java
Wed Sep 15 11:38:27 2010
@@ -785,7 +785,7 @@ public class ActiveMQBytesMessage extend
                 }
                 length = 0;
                 compressed = true;
-                Deflater deflater = new Deflater(Deflater.BEST_SPEED);
+                final Deflater deflater = new Deflater(Deflater.BEST_SPEED);
                 os = new FilterOutputStream(new DeflaterOutputStream(os, deflater)) {
                     public void write(byte[] arg0) throws IOException {
                         length += arg0.length;
@@ -801,6 +801,12 @@ public class ActiveMQBytesMessage extend
                         length++;
                         out.write(arg0);
                     }
+
+                    @Override
+                    public void close() throws IOException {
+                        deflater.end();
+                        super.close();
+                    }
                 };
             }
             this.dataOut = new DataOutputStream(os);



Mime
View raw message