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

Writing int[] into a file #43

Open
mokun opened this issue Nov 8, 2019 · 1 comment
Open

Writing int[] into a file #43

mokun opened this issue Nov 8, 2019 · 1 comment

Comments

@mokun
Copy link

mokun commented Nov 8, 2019

Assume I have 10,000 int, which range from -9000 to +21000 in value.

What would be the strategy of writing the int[] already compressed by JavaFastPFOR into a file for archive ?

Should I assume I need to convert each int into 4 bytes ?

So will an int[] array with 10,000 values will be saved as a byte[] array with the size of 40,000 ?

Any other more optimal way to save the data into a file ?

@lemire
Copy link
Member

lemire commented Nov 8, 2019

Are you asking how to serialize an array of ints to disk?

You can either use a DataOutput or a ByteBuffer.

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