protected override ChunkInfo GetChunkInfo(ulong[] chunkIndices) { // H5Dearray.c (H5D__earray_idx_get_addr) /* Check for unlimited dim. not being the slowest-changing dim. */ ulong chunkIndex; if (_unlimitedDim > 0) { var swizzledCoords = new ulong[this.ChunkRank]; /* Compute coordinate offset from scaled offset */ for (int i = 0; i < this.ChunkRank; i++) { swizzledCoords[i] = chunkIndices[i] * this.ChunkDims[i]; } H5Utils.SwizzleCoords(swizzledCoords, _unlimitedDim); /* Calculate the index of this chunk */ var swizzledScaledDims = swizzledCoords .Select((swizzledCoord, i) => H5Utils.CeilDiv(swizzledCoord, _swizzledChunkDims[i])) .ToArray(); chunkIndex = swizzledScaledDims.ToLinearIndexPrecomputed(_swizzledDownMaxChunkCounts); } else { /* Calculate the index of this chunk */ chunkIndex = chunkIndices.ToLinearIndexPrecomputed(this.DownMaxChunkCounts); } /* Check for filters on chunks */ if (this.Dataset.InternalFilterPipeline is not null) { var chunkSizeLength = H5Utils.ComputeChunkSizeLength(this.ChunkByteSize); var element = this.GetElement(chunkIndex, reader => { return(new FilteredDataBlockElement() { Address = this.Dataset.Context.Superblock.ReadOffset(reader), ChunkSize = (uint)H5Utils.ReadUlong(reader, chunkSizeLength), FilterMask = reader.ReadUInt32() }); }); return(element is not null ? new ChunkInfo(element.Address, element.ChunkSize, element.FilterMask) : ChunkInfo.None); } else { var element = this.GetElement(chunkIndex, reader => { return(new DataBlockElement() { Address = this.Dataset.Context.Superblock.ReadOffset(reader) }); }); return(element is not null ? new ChunkInfo(element.Address, this.ChunkByteSize, 0) : ChunkInfo.None); } }