File tree Expand file tree Collapse file tree
src/main/java/org/janelia/saalfeldlab/n5 Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -327,6 +327,24 @@ boolean deleteBlock(
327327 final String datasetPath ,
328328 final long ... gridPosition ) throws N5Exception ;
329329
330+ /**
331+ * Deletes the blocks at the given {@code gridPositions}.
332+ *
333+ * @param datasetPath dataset path
334+ * @param gridPositions a list of grid positions
335+ * @return {@code true} if any of the specified blocks existed and was deleted
336+ * @throws N5Exception if any of the block exists but could not be deleted
337+ */
338+ default boolean deleteBlocks (
339+ final String datasetPath ,
340+ final List <long []> gridPositions ) throws N5Exception {
341+ boolean deleted = false ;
342+ for (long [] pos : gridPositions ) {
343+ deleted |= deleteBlock (datasetPath , pos );
344+ }
345+ return deleted ;
346+ }
347+
330348 /**
331349 * Save a {@link Serializable} as an N5 {@link DataBlock} at a given offset.
332350 * The
Original file line number Diff line number Diff line change @@ -34,6 +34,9 @@ public interface DatasetAccess<T> {
3434
3535 void writeBlocks (PositionValueAccess kva , List <DataBlock <T >> blocks ) throws N5IOException ;
3636
37+ // TODO:
38+ // boolean deleteBlocks(PositionValueAccess kva, List<long[]> positions) throws N5IOException;
39+
3740
3841 /**
3942 *
You can’t perform that action at this time.
0 commit comments