JavaFastPFOR
JavaFastPFOR copied to clipboard
Writing int[] into a file
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 ?
Are you asking how to serialize an array of ints to disk?
You can either use a DataOutput or a ByteBuffer.