What do you think would be the best way (especially in terms of space on the hdd/ssd/...) to save (not print) a huge vector (e.g. a vector of 109 ints (4gb)) to a file, being able to open/read from/reallocate it in RAM at a later time?
I don't want to print it to the file, because than the file would have the size of one byte per each digit of each number (plus one byte for a ',' or a '\n' or something to separate each number, and another byte for '-' whenever the number is negative...). That, in most cases, would be a waste of space, and would also be a slow approach to re-open it at a later time.
I mean, is it possible to write a vector (or also an array) to a file directly, without representing it in a set of "readable" characters through, for example, NotePad? I'm not interested if any other program won't be capable of read that file.