How to speed up processing of gigabyte-scale files: split them into chunks (chunking), use positional access via
FileChannel and memory-mapped buffers
MappedByteBuffer, and parallelise computations with
ExecutorService. We’ll cover key methods of positional I/O:
position(...),
read(...),
write(...), criteria for choosing the chunk size, an example of parallel word counting, and typical mistakes (chunk boundaries, resources, number of threads).