@@ -208,7 +208,7 @@ public void uncompress(InputStream is, OutputStream os) throws IOException {
208208 }
209209 }
210210
211- static class BloscCompressor extends Compressor {
211+ public static class BloscCompressor extends Compressor {
212212
213213 final static int AUTOSHUFFLE = -1 ;
214214 final static int NOSHUFFLE = 0 ;
@@ -228,14 +228,13 @@ static class BloscCompressor extends Compressor {
228228 public final static int [] supportedShuffle = new int []{/*AUTOSHUFFLE, */ NOSHUFFLE , BYTESHUFFLE , BITSHUFFLE };
229229 public final static String [] supportedCnames = new String []{"zstd" , "blosclz" , defaultCname , "lz4hc" , "zlib" /*, "snappy"*/ };
230230
231- public final static Map <String , Object > defaultProperties = Collections
232- .unmodifiableMap (new HashMap <String , Object >() {{
231+ public final static Map <String , Object > defaultProperties = new HashMap <String , Object >() {{
233232 put (keyCname , defaultCname );
234233 put (keyClevel , defaultCLevel );
235234 put (keyShuffle , defaultShuffle );
236235 put (keyBlocksize , defaultBlocksize );
237236 put (keyNumThreads , defaultNumThreads );
238- }}) ;
237+ }};
239238
240239 private final int clevel ;
241240 private final int blocksize ;
@@ -290,10 +289,11 @@ private BloscCompressor(Map<String, Object> map) {
290289 this .blocksize = ((Number ) blocksizeObj ).intValue ();
291290 }
292291
293- final Object nthreadsObj = map .get (keyNumThreads );
292+ Object nthreadsObj = map .get (keyNumThreads );
294293 if (nthreadsObj == null ) {
295- this .nthreads = defaultNumThreads ;
296- } else if (nthreadsObj instanceof String ) {
294+ nthreadsObj = defaultProperties .get (keyNumThreads );
295+ }
296+ if (nthreadsObj instanceof String ) {
297297 this .nthreads = Integer .parseInt ((String ) nthreadsObj );
298298 } else {
299299 this .nthreads = ((Number ) nthreadsObj ).intValue ();
0 commit comments