Skip to content

Commit

Permalink
fix: UnsupportedOperationException for blosc and strings
Browse files Browse the repository at this point in the history
  • Loading branch information
bogovicj committed Feb 6, 2024
1 parent 79f065d commit ebd009d
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/main/java/org/janelia/saalfeldlab/n5/StringDataBlock.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,13 @@ public ByteBuffer toByteBuffer() {

@Override
public void readData(final ByteBuffer buffer) {
if (buffer.array() != serializedData)
buffer.get(serializedData);
actualData = deserialize(buffer.array());

if (buffer.hasArray()) {
if (buffer.array() != serializedData)
buffer.get(serializedData);
actualData = deserialize(buffer.array());
} else
actualData = ENCODING.decode(buffer).toString().split(NULLCHAR);
}

protected byte[] serialize(String[] strings) {
Expand Down

0 comments on commit ebd009d

Please sign in to comment.