191 * is made. 192 * 193 * <p> If this buffer was not mapped in read/write mode ({@link 194 * java.nio.channels.FileChannel.MapMode#READ_WRITE}) then invoking this 195 * method has no effect. </p> 196 * 197 * @return This buffer 198 */ 199 public final MappedByteBuffer force() { 200 checkMapped(); 201 if ((address != 0) && (capacity() != 0)) { 202 long offset = mappingOffset(); 203 force0(fd, mappingAddress(offset), mappingLength(offset)); 204 } 205 return this; 206 } 207 208 private native boolean isLoaded0(long address, long length, int pageCount); 209 private native void load0(long address, long length); 210 private native void force0(FileDescriptor fd, long address, long length); 211 } | 191 * is made. 192 * 193 * <p> If this buffer was not mapped in read/write mode ({@link 194 * java.nio.channels.FileChannel.MapMode#READ_WRITE}) then invoking this 195 * method has no effect. </p> 196 * 197 * @return This buffer 198 */ 199 public final MappedByteBuffer force() { 200 checkMapped(); 201 if ((address != 0) && (capacity() != 0)) { 202 long offset = mappingOffset(); 203 force0(fd, mappingAddress(offset), mappingLength(offset)); 204 } 205 return this; 206 } 207 208 private native boolean isLoaded0(long address, long length, int pageCount); 209 private native void load0(long address, long length); 210 private native void force0(FileDescriptor fd, long address, long length); 211 212 // -- Covariant return type overrides 213 214 /** 215 * {@inheritDoc} 216 */ 217 @Override 218 public MappedByteBuffer position(int newPosition) { 219 super.position(newPosition); 220 return this; 221 } 222 223 /** 224 * {@inheritDoc} 225 */ 226 @Override 227 public MappedByteBuffer limit(int newLimit) { 228 super.limit(newLimit); 229 return this; 230 } 231 232 /** 233 * {@inheritDoc} 234 */ 235 @Override 236 public MappedByteBuffer mark() { 237 super.mark(); 238 return this; 239 } 240 241 /** 242 * {@inheritDoc} 243 */ 244 @Override 245 public MappedByteBuffer reset() { 246 super.reset(); 247 return this; 248 } 249 250 /** 251 * {@inheritDoc} 252 */ 253 @Override 254 public MappedByteBuffer clear() { 255 super.clear(); 256 return this; 257 } 258 259 /** 260 * {@inheritDoc} 261 */ 262 @Override 263 public MappedByteBuffer flip() { 264 super.flip(); 265 return this; 266 } 267 268 /** 269 * {@inheritDoc} 270 */ 271 @Override 272 public MappedByteBuffer rewind() { 273 super.rewind(); 274 return this; 275 } 276 } |