code: public boolean lock(final boolean readOnly) throws IOException {
  		if (isOpen() && lock == null) {
  			lock = fileChannel.lock(0L, Long.MAX_VALUE, readOnly);
  			return true;
  		}
  		return false;
  	}
docs: Lock file
  
  @throws IOException