Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/main/java/com/bc/zarr/CompressorFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ public void uncompress(InputStream is, OutputStream os) throws IOException {
}
}

static class BloscCompressor extends Compressor {
public static class BloscCompressor extends Compressor {

final static int AUTOSHUFFLE = -1;
final static int NOSHUFFLE = 0;
Expand All @@ -228,14 +228,13 @@ static class BloscCompressor extends Compressor {
public final static int[] supportedShuffle = new int[]{/*AUTOSHUFFLE, */NOSHUFFLE, BYTESHUFFLE, BITSHUFFLE};
public final static String[] supportedCnames = new String[]{"zstd", "blosclz", defaultCname, "lz4hc", "zlib"/*, "snappy"*/};

public final static Map<String, Object> defaultProperties = Collections
.unmodifiableMap(new HashMap<String, Object>() {{
public final static Map<String, Object> defaultProperties = new HashMap<String, Object>() {{
put(keyCname, defaultCname);
put(keyClevel, defaultCLevel);
put(keyShuffle, defaultShuffle);
put(keyBlocksize, defaultBlocksize);
put(keyNumThreads, defaultNumThreads);
}});
}};

private final int clevel;
private final int blocksize;
Expand Down Expand Up @@ -290,10 +289,11 @@ private BloscCompressor(Map<String, Object> map) {
this.blocksize = ((Number) blocksizeObj).intValue();
}

final Object nthreadsObj = map.get(keyNumThreads);
Object nthreadsObj = map.get(keyNumThreads);
if (nthreadsObj == null) {
this.nthreads = defaultNumThreads;
} else if (nthreadsObj instanceof String) {
nthreadsObj = defaultProperties.get(keyNumThreads);
}
if (nthreadsObj instanceof String) {
this.nthreads = Integer.parseInt((String) nthreadsObj);
} else {
this.nthreads = ((Number) nthreadsObj).intValue();
Expand Down