Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Big-endian data #63

Open
tjdiamandis opened this issue Aug 2, 2021 · 2 comments
Open

Big-endian data #63

tjdiamandis opened this issue Aug 2, 2021 · 2 comments

Comments

@tjdiamandis
Copy link

Hello,

How difficult is it to add Big-endian functionality for zopen? Happy to work on this if some guidance is provided.

Thank you!

https://github.com/meggart/Zarr.jl/blob/3aaf6d0555b0a69a585da5c69334eedef6ee2b51/src/metadata.jl#L90

@meggart
Copy link
Collaborator

meggart commented Aug 3, 2021

Thanks a lot for offering help here.

The first step to support big-endian data would be to first remove the exception so that arrrays can be opened. Then I would try to hook into the readchunk! and writechunk! functions (defined in ZArray.jl), because every array access passes through these functions. So it should be sufficient to add a check in readchunk! that tests for endianness in the array's metadata and applies ntoh to the output array a in-place if necessary. The same could be done for writechunk! as well.

Let me know if that already helps or if you need more details.

@tjdiamandis
Copy link
Author

Makes sense. Thank you very much! I'll take a look soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants