https://issues.apache.org/activemq/browse/AMQ-2919 - Deflater.end() should be called from ActiveMQBytesMessage

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@997290 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Bosanac Dejan 2010-09-15 11:38:27 +00:00
parent 5bf3696c81
commit a0b017611b
1 changed files with 7 additions and 1 deletions

View File

@ -785,7 +785,7 @@ public class ActiveMQBytesMessage extends ActiveMQMessage implements BytesMessag
}
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 extends ActiveMQMessage implements BytesMessag
length++;
out.write(arg0);
}
@Override
public void close() throws IOException {
deflater.end();
super.close();
}
};
}
this.dataOut = new DataOutputStream(os);