From faf0d3accd3b67d0729714b26a4795a245a2ef7f Mon Sep 17 00:00:00 2001 From: marcobitplane <139451784+marcobitplane@users.noreply.github.com> Date: Mon, 23 Sep 2024 09:55:11 +0200 Subject: [PATCH] Add method to get decompressed chunk --- .../io/jhdf/dataset/chunked/ChunkedDatasetBase.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/jhdf/src/main/java/io/jhdf/dataset/chunked/ChunkedDatasetBase.java b/jhdf/src/main/java/io/jhdf/dataset/chunked/ChunkedDatasetBase.java index dbebf256..e67e32fb 100644 --- a/jhdf/src/main/java/io/jhdf/dataset/chunked/ChunkedDatasetBase.java +++ b/jhdf/src/main/java/io/jhdf/dataset/chunked/ChunkedDatasetBase.java @@ -291,6 +291,16 @@ public ByteBuffer getRawChunkBuffer(int[] chunkOffset) { return getDataBuffer(chunk); } + @Override + public byte[] getDecompressedChunk(int[] chunkOffset) { + final Chunk chunk = getChunk(new ChunkOffset(chunkOffset)); + if (chunk == null) { + throw new HdfException("No chunk with offset " + Arrays.toString(chunkOffset) + + " in dataset: " + getPath()); + } + return decompressChunk(chunk); + } + private Collection getAllChunks() { return getChunkLookup().values(); }