Package com.bc.zarr
Class ZarrUtils
- java.lang.Object
-
- com.bc.zarr.ZarrUtils
-
public final class ZarrUtils extends Object
-
-
Constructor Summary
Constructors Constructor Description ZarrUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static int[][]computeChunkIndices(int[] shape, int[] chunks, int[] bufferShape, int[] to)static longcomputeSize(int[] ints)static intcomputeSizeInteger(int[] ints)static voidconsolidateMetadata(Store store)static StringcreateChunkFilename(int[] currentIdx, String separatorChar)static ObjectcreateDataBuffer(DataType dataType, int[] shape)static ObjectcreateDataBufferFilledWith(Number value, DataType dataType, int[] shape)static voiddeleteDirectoryTreeRecursively(Path toBeDeleted)static voidensureDirectory(Path groupPath)static voidensureFileExistAndIsReadable(Path dotZGroupPath)static <T> TfromJson(Reader reader, Class<T> classOfType)static StringnormalizeStoragePath(String path)static Map<String,Object>readAttributes(com.bc.zarr.ZarrPath zarrPath, Store store)static StringtoJson(Object src)static StringtoJson(Object src, boolean prettyPrinting)static voidtoJson(Object o, Writer writer)static voidtoJson(Object o, Writer writer, boolean prettyPrinting)static voidwriteAttributes(Map<String,Object> attributes, com.bc.zarr.ZarrPath zarrPath, Store store)
-
-
-
Method Detail
-
toJson
public static String toJson(Object src) throws JZarrException
- Throws:
JZarrException
-
toJson
public static String toJson(Object src, boolean prettyPrinting) throws JZarrException
- Throws:
JZarrException
-
toJson
public static void toJson(Object o, Writer writer) throws IOException
- Throws:
IOException
-
toJson
public static void toJson(Object o, Writer writer, boolean prettyPrinting) throws IOException
- Throws:
IOException
-
computeChunkIndices
public static int[][] computeChunkIndices(int[] shape, int[] chunks, int[] bufferShape, int[] to)
-
createChunkFilename
public static String createChunkFilename(int[] currentIdx, String separatorChar)
-
fromJson
public static <T> T fromJson(Reader reader, Class<T> classOfType) throws IOException
- Throws:
IOException
-
computeSize
public static long computeSize(int[] ints)
-
computeSizeInteger
public static int computeSizeInteger(int[] ints)
-
ensureFileExistAndIsReadable
public static void ensureFileExistAndIsReadable(Path dotZGroupPath) throws IOException
- Throws:
IOException
-
ensureDirectory
public static void ensureDirectory(Path groupPath) throws IOException
- Throws:
IOException
-
writeAttributes
public static void writeAttributes(Map<String,Object> attributes, com.bc.zarr.ZarrPath zarrPath, Store store) throws IOException
- Throws:
IOException
-
readAttributes
public static Map<String,Object> readAttributes(com.bc.zarr.ZarrPath zarrPath, Store store) throws IOException
- Throws:
IOException
-
deleteDirectoryTreeRecursively
public static void deleteDirectoryTreeRecursively(Path toBeDeleted) throws IOException
- Throws:
IOException
-
createDataBufferFilledWith
public static Object createDataBufferFilledWith(Number value, DataType dataType, int[] shape)
-
consolidateMetadata
public static void consolidateMetadata(Store store) throws IOException
- Throws:
IOException
-
-