avro-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cutt...@apache.org
Subject svn commit: r1480771 - in /avro/trunk: CHANGES.txt lang/java/avro/src/main/java/org/apache/avro/file/BZip2Codec.java lang/java/avro/src/test/java/org/apache/avro/file/TestBZip2Codec.java
Date Thu, 09 May 2013 21:04:47 GMT
Author: cutting
Date: Thu May  9 21:04:47 2013
New Revision: 1480771

URL: http://svn.apache.org/r1480771
Log:
AVRO-1326. Java: Fix bug in BZip2 codec.

Modified:
    avro/trunk/CHANGES.txt
    avro/trunk/lang/java/avro/src/main/java/org/apache/avro/file/BZip2Codec.java
    avro/trunk/lang/java/avro/src/test/java/org/apache/avro/file/TestBZip2Codec.java

Modified: avro/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/avro/trunk/CHANGES.txt?rev=1480771&r1=1480770&r2=1480771&view=diff
==============================================================================
--- avro/trunk/CHANGES.txt (original)
+++ avro/trunk/CHANGES.txt Thu May  9 21:04:47 2013
@@ -75,6 +75,8 @@ Trunk (not yet released)
     AVRO-1320. Java: Fix Trevni to correctly read unions and specific enums.
     (cutting)
 
+    AVRO-1326. Java: Fix bug in BZip2 codec. (cutting)
+
 Avro 1.7.4 (22 February 2012)
 
   NEW FEATURES

Modified: avro/trunk/lang/java/avro/src/main/java/org/apache/avro/file/BZip2Codec.java
URL: http://svn.apache.org/viewvc/avro/trunk/lang/java/avro/src/main/java/org/apache/avro/file/BZip2Codec.java?rev=1480771&r1=1480770&r2=1480771&view=diff
==============================================================================
--- avro/trunk/lang/java/avro/src/main/java/org/apache/avro/file/BZip2Codec.java (original)
+++ avro/trunk/lang/java/avro/src/main/java/org/apache/avro/file/BZip2Codec.java Thu May 
9 21:04:47 2013
@@ -48,7 +48,9 @@ public class BZip2Codec extends Codec {
     BZip2CompressorOutputStream outputStream = new BZip2CompressorOutputStream(baos);
 
     try {
-      outputStream.write(uncompressedData.array());
+      outputStream.write(uncompressedData.array(),
+                         uncompressedData.position(),
+                         uncompressedData.remaining());
     } finally {
       outputStream.close();
     }

Modified: avro/trunk/lang/java/avro/src/test/java/org/apache/avro/file/TestBZip2Codec.java
URL: http://svn.apache.org/viewvc/avro/trunk/lang/java/avro/src/test/java/org/apache/avro/file/TestBZip2Codec.java?rev=1480771&r1=1480770&r2=1480771&view=diff
==============================================================================
--- avro/trunk/lang/java/avro/src/test/java/org/apache/avro/file/TestBZip2Codec.java (original)
+++ avro/trunk/lang/java/avro/src/test/java/org/apache/avro/file/TestBZip2Codec.java Thu May
 9 21:04:47 2013
@@ -41,7 +41,8 @@ public class TestBZip2Codec {
       inputByteArray[i] = (byte)(65 + i % 10);
     }
     
-    ByteBuffer inputByteBuffer = ByteBuffer.wrap(inputByteArray);
+    ByteBuffer inputByteBuffer = ByteBuffer.allocate(inputByteSize * 2);
+    inputByteBuffer.put(inputByteArray);
     
     ByteBuffer compressedBuffer = codec.compress(inputByteBuffer);
     



Mime
View raw message