readAsMemory

inline fun <R> Path.readAsMemory(position: Long = 0, size: Long = Files.size(this), block: Memory.() -> R): R(source)

Uses direct memory-mapped buffer from file to read something and close it afterward.