Docs on close()

This commit is contained in:
Sebastiano Vigna 2022-02-25 09:14:12 +01:00
parent 88e2dd18e2
commit 4e5ab259cc

View file

@ -39,10 +39,13 @@ import java.util.Arrays;
* <p>Mapping can happen with a specified byte order: saving and mapping data in {@linkplain ByteOrder#nativeOrder() native order}
* using methods from {@link it.unimi.dsi.fastutil.io.BinIO} will enhance performance significantly.
*
* <p>After usage, you should {@link #close()} instances of this class to release the associated {@link FileChannel}.
*
* <p>Instances of this class are not thread safe, but the {@link #copy()} method provides a lightweight
* duplicate that can be read independently by another thread.
* Only chunks that are actually used will be {@linkplain ByteBuffer#duplicate() duplicated} lazily.
* If you are modifiying the content of list, however, you will need to provide external synchronization.
* Note that the {@link #close()} method, when invoked on any copy, will stop mapping of all copies.
*
* @author Sebastiano Vigna
*/