An augmented reader that provides more operations can be constructed using PrimIO.augmentIn , but it may be more efficient to use the functions directly provided by the reader, instead of relying on the constructed ones. The same applies to augmented writers. However, in a typical implementation of readVec , this requires pre-allocating a vector of size n . Therefore, for large input operations, query the size of the reader using endPos , subtract the current position, and try to read that much. But one should also keep things rounded to the nearest chunkSize .
Similar suggestions apply to very large output operations.
Very large outputs can be written directly from the argument string using writeVec . The input function should return the largest sequence that is most convenient. To support lazy functional streams, readArr and readArrNB are not useful. If necessary, readVec should be synthesized from readArr and readVecNB from readArrNB . Similarly for writeArrNB and writeVecNB .