Memory map the document file as an array of bytes then split.

Memory-mapping the document prevents accidental overwriting of the original lines and, for large files, can be faster.