< prev index next >

src/java.base/share/classes/sun/nio/ch/FileChannelImpl.java

Print this page

        

*** 999,1010 **** FileDescriptor dummy = new FileDescriptor(); if ((!writable) || (prot == MAP_RO)) return Util.newMappedByteBufferR(0, 0, dummy, null, isSync); else return Util.newMappedByteBuffer(0, 0, dummy, null, isSync); ! } ! else if ((!writable) || (prot == MAP_RO)) { return Util.newMappedByteBufferR((int)unmapper.cap, unmapper.address + unmapper.pagePosition, unmapper.fd, unmapper, isSync); } else { --- 999,1009 ---- FileDescriptor dummy = new FileDescriptor(); if ((!writable) || (prot == MAP_RO)) return Util.newMappedByteBufferR(0, 0, dummy, null, isSync); else return Util.newMappedByteBuffer(0, 0, dummy, null, isSync); ! } else if ((!writable) || (prot == MAP_RO)) { return Util.newMappedByteBufferR((int)unmapper.cap, unmapper.address + unmapper.pagePosition, unmapper.fd, unmapper, isSync); } else {
*** 1121,1137 **** mode == ExtendedMapMode.READ_WRITE_SYNC; } private int toProt(MapMode mode) { int prot; ! if (mode == MapMode.READ_ONLY) prot = MAP_RO; ! else if (mode == MapMode.READ_WRITE) prot = MAP_RW; ! else if (mode == MapMode.PRIVATE) prot = MAP_PV; ! else if (mode == ExtendedMapMode.READ_ONLY_SYNC) { prot = MAP_RO; } else if (mode == ExtendedMapMode.READ_WRITE_SYNC) { prot = MAP_RW; } else { prot = MAP_INVALID; --- 1120,1136 ---- mode == ExtendedMapMode.READ_WRITE_SYNC; } private int toProt(MapMode mode) { int prot; ! if (mode == MapMode.READ_ONLY) { prot = MAP_RO; ! } else if (mode == MapMode.READ_WRITE) { prot = MAP_RW; ! } else if (mode == MapMode.PRIVATE) { prot = MAP_PV; ! } else if (mode == ExtendedMapMode.READ_ONLY_SYNC) { prot = MAP_RO; } else if (mode == ExtendedMapMode.READ_WRITE_SYNC) { prot = MAP_RW; } else { prot = MAP_INVALID;
< prev index next >