mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +02:00
8221397: Support implementation-defined Map Modes
Allow implementation-defined extensions to FileChannel MapMode enum Reviewed-by: alanb
This commit is contained in:
parent
4a477cabd8
commit
1c7d214f53
2 changed files with 27 additions and 13 deletions
|
@ -940,14 +940,15 @@ public class FileChannelImpl
|
|||
if (size > Integer.MAX_VALUE)
|
||||
throw new IllegalArgumentException("Size exceeds Integer.MAX_VALUE");
|
||||
|
||||
int imode = -1;
|
||||
int imode;
|
||||
if (mode == MapMode.READ_ONLY)
|
||||
imode = MAP_RO;
|
||||
else if (mode == MapMode.READ_WRITE)
|
||||
imode = MAP_RW;
|
||||
else if (mode == MapMode.PRIVATE)
|
||||
imode = MAP_PV;
|
||||
assert (imode >= 0);
|
||||
else
|
||||
throw new UnsupportedOperationException();
|
||||
if ((mode != MapMode.READ_ONLY) && !writable)
|
||||
throw new NonWritableChannelException();
|
||||
if (!readable)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue