Skip to content
Permalink
Browse files

Fix #139 reading string datasets from chunked v4 files no longer fails

  • Loading branch information
jamesmudd committed Dec 19, 2019
1 parent 6db7c00 commit e4a694c9029d67741b5003049dbcd9e1a54e5078
Showing with 6 additions and 0 deletions.
  1. +6 −0 jhdf/src/main/java/io/jhdf/dataset/VariableLengthDatasetReader.java
@@ -16,6 +16,7 @@

import java.lang.reflect.Array;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.Arrays;
@@ -25,6 +26,8 @@
import java.util.Map;
import java.util.stream.IntStream;

import static java.nio.ByteOrder.LITTLE_ENDIAN;

public final class VariableLengthDatasetReader {

/** No instances */
@@ -96,6 +99,9 @@ private static void fillData(Object data, int[] dims, Iterator<String> objects)

final int skipBytes = length - hdfFc.getSizeOfOffsets() - 4; // id=4

// Assume all global heap buffers are little endian
bb.order(LITTLE_ENDIAN);

while (bb.remaining() >= length) {
// Move past the skipped bytes. TODO figure out what this is for
bb.position(bb.position() + skipBytes);

0 comments on commit e4a694c

Please sign in to comment.
You can’t perform that action at this time.