This is an automated email from the ASF dual-hosted git repository.

haonan pushed a commit to branch iotdb
in repository https://gitbox.apache.org/repos/asf/tsfile.git

commit 9c68a357f02889ec7c2e575e6fd6a6c6ad5f76d0
Author: shuwenwei <[email protected]>
AuthorDate: Fri Jul 5 19:35:50 2024 +0800

    Fix uncompress page data (#161)
    
    * fix uncompress
    
    * modify position
---
 .../java/org/apache/tsfile/read/reader/chunk/ChunkReader.java     | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git 
a/java/tsfile/src/main/java/org/apache/tsfile/read/reader/chunk/ChunkReader.java
 
b/java/tsfile/src/main/java/org/apache/tsfile/read/reader/chunk/ChunkReader.java
index dc5af465..1b747739 100644
--- 
a/java/tsfile/src/main/java/org/apache/tsfile/read/reader/chunk/ChunkReader.java
+++ 
b/java/tsfile/src/main/java/org/apache/tsfile/read/reader/chunk/ChunkReader.java
@@ -169,7 +169,11 @@ public class ChunkReader extends AbstractChunkReader {
     byte[] uncompressedPageData = new byte[pageHeader.getUncompressedSize()];
     try {
       unCompressor.uncompress(
-          compressedPageData.array(), 0, compressedPageBodyLength, 
uncompressedPageData, 0);
+          compressedPageData.array(),
+          compressedPageData.arrayOffset() + compressedPageData.position(),
+          compressedPageBodyLength,
+          uncompressedPageData,
+          0);
     } catch (Exception e) {
       throw new IOException(
           "Uncompress error! uncompress size: "
@@ -180,7 +184,7 @@ public class ChunkReader extends AbstractChunkReader {
               + pageHeader
               + e.getMessage());
     }
-
+    compressedPageData.position(compressedPageData.position() + 
compressedPageBodyLength);
     return ByteBuffer.wrap(uncompressedPageData);
   }
 

Reply via email to