James Strachan 2007-06-25 06:57:35 +00:00
parent 8842445fe4
commit 149fffda77
1 changed files with 12 additions and 1 deletions

View File

@ -74,10 +74,11 @@ public class ActiveMQTextMessage extends ActiveMQMessage implements TextMessage
public String getText() throws JMSException {
if (text == null && getContent() != null) {
InputStream is = null;
try {
ByteSequence bodyAsBytes = getContent();
if (bodyAsBytes != null) {
InputStream is = new ByteArrayInputStream(bodyAsBytes);
is = new ByteArrayInputStream(bodyAsBytes);
if( isCompressed() ) {
is = new InflaterInputStream(is);
}
@ -89,6 +90,16 @@ public class ActiveMQTextMessage extends ActiveMQMessage implements TextMessage
} catch (IOException ioe) {
throw JMSExceptionSupport.create(ioe);
}
finally {
if (is != null) {
try {
is.close();
}
catch (IOException e) {
// ignore
}
}
}
}
return text;
}