src/java.base/share/classes/sun/nio/ch/FileChannelImpl.java
changeset 54532 e9c62d960d64
parent 53324 cbb8341a127a
child 57804 9b7b9f16dfd9
equal deleted inserted replaced
54531:edf1b4c6b936 54532:e9c62d960d64
   938         if (position + size < 0)
   938         if (position + size < 0)
   939             throw new IllegalArgumentException("Position + size overflow");
   939             throw new IllegalArgumentException("Position + size overflow");
   940         if (size > Integer.MAX_VALUE)
   940         if (size > Integer.MAX_VALUE)
   941             throw new IllegalArgumentException("Size exceeds Integer.MAX_VALUE");
   941             throw new IllegalArgumentException("Size exceeds Integer.MAX_VALUE");
   942 
   942 
   943         int imode = -1;
   943         int imode;
   944         if (mode == MapMode.READ_ONLY)
   944         if (mode == MapMode.READ_ONLY)
   945             imode = MAP_RO;
   945             imode = MAP_RO;
   946         else if (mode == MapMode.READ_WRITE)
   946         else if (mode == MapMode.READ_WRITE)
   947             imode = MAP_RW;
   947             imode = MAP_RW;
   948         else if (mode == MapMode.PRIVATE)
   948         else if (mode == MapMode.PRIVATE)
   949             imode = MAP_PV;
   949             imode = MAP_PV;
   950         assert (imode >= 0);
   950         else
       
   951             throw new UnsupportedOperationException();
   951         if ((mode != MapMode.READ_ONLY) && !writable)
   952         if ((mode != MapMode.READ_ONLY) && !writable)
   952             throw new NonWritableChannelException();
   953             throw new NonWritableChannelException();
   953         if (!readable)
   954         if (!readable)
   954             throw new NonReadableChannelException();
   955             throw new NonReadableChannelException();
   955 
   956