manzt / zarrita.js

A JavaScript toolkit for working with chunked, compressed, n-dimensional arrays
https://zarrita.dev
MIT License
39 stars 5 forks source link

feat(indexing): generalize buffer-backed operations #103

Closed manzt closed 1 year ago

manzt commented 1 year ago

All the array containers (except for Array) are backed by ArrayBuffer, but we currently have special handling for our string array containers.

This PR generalizes the indexing algorithm to operate on the "raw" bytes directly for any data. This way we only move contigous blocks of binary data between src and target and avoid needing to move data out of the buffers into JS objects.