[hornetq-commits] JBoss hornetq SVN: r9880 - branches/Branch_Large_Message_Compression/src/main/org/hornetq/utils.
do-not-reply at jboss.org
do-not-reply at jboss.org
Fri Nov 12 01:51:54 EST 2010
Author: gaohoward
Date: 2010-11-12 01:51:54 -0500 (Fri, 12 Nov 2010)
New Revision: 9880
Modified:
branches/Branch_Large_Message_Compression/src/main/org/hornetq/utils/DecompressedLargeMessageBuffer.java
branches/Branch_Large_Message_Compression/src/main/org/hornetq/utils/GZipUtil.java
branches/Branch_Large_Message_Compression/src/main/org/hornetq/utils/HornetQBufferInputStream.java
Log:
added a convenient method for creating GZIPInputStream
Modified: branches/Branch_Large_Message_Compression/src/main/org/hornetq/utils/DecompressedLargeMessageBuffer.java
===================================================================
--- branches/Branch_Large_Message_Compression/src/main/org/hornetq/utils/DecompressedLargeMessageBuffer.java 2010-11-12 05:23:35 UTC (rev 9879)
+++ branches/Branch_Large_Message_Compression/src/main/org/hornetq/utils/DecompressedLargeMessageBuffer.java 2010-11-12 06:51:54 UTC (rev 9880)
@@ -162,7 +162,7 @@
{
InputStream input = new HornetQBufferInputStream(bufferDelegate);
- dataInput = new DataInputStream(GZipUtil.pipeGZip(input, false, threadPool));
+ dataInput = new DataInputStream(GZipUtil.createUnZipInputStream(input));
}
catch (Exception e)
{
Modified: branches/Branch_Large_Message_Compression/src/main/org/hornetq/utils/GZipUtil.java
===================================================================
--- branches/Branch_Large_Message_Compression/src/main/org/hornetq/utils/GZipUtil.java 2010-11-12 05:23:35 UTC (rev 9879)
+++ branches/Branch_Large_Message_Compression/src/main/org/hornetq/utils/GZipUtil.java 2010-11-12 06:51:54 UTC (rev 9880)
@@ -179,6 +179,18 @@
throw new HornetQException(HornetQException.LARGE_MESSAGE_ERROR_BODY, e.getMessage(), e);
}
}
+
+ public static InputStream createUnZipInputStream(InputStream input) throws HornetQException
+ {
+ try
+ {
+ return new GZIPInputStream(input);
+ }
+ catch (IOException e)
+ {
+ throw new HornetQException(HornetQException.LARGE_MESSAGE_ERROR_BODY, e.getMessage(), e);
+ }
+ }
/*
* we keep a list of byte arrays. when writing, we start with the first array.
Modified: branches/Branch_Large_Message_Compression/src/main/org/hornetq/utils/HornetQBufferInputStream.java
===================================================================
--- branches/Branch_Large_Message_Compression/src/main/org/hornetq/utils/HornetQBufferInputStream.java 2010-11-12 05:23:35 UTC (rev 9879)
+++ branches/Branch_Large_Message_Compression/src/main/org/hornetq/utils/HornetQBufferInputStream.java 2010-11-12 06:51:54 UTC (rev 9880)
@@ -61,7 +61,7 @@
}
else
{
- return bb.readByte();
+ return bb.readByte() & 0xFF;
}
}
More information about the hornetq-commits
mailing list