Memory-Mapped Files mit Java
Von Carsten
Das wußte ich auch noch nicht:
A region of a file may be mapped directly into memory; for large files this is often much more efficient than invoking the usual
read
orwrite
methods.
Weiterlesen in den JDK API Docs FileChannel#map(…). Und aufpassen:
A mapping, once established, is not dependent upon the file channel that was used to create it. Closing the channel, in particular, has no effect upon the validity of the mapping.
Das ist dann wieder so ein Ding, an dem man sich totsucht, wenn man fremden Code übernimmt, oder?