code: public void clear() {
  		if (!validState) {
  			throw new InvalidStateException();
  		}
  		try {
  			fileChannel.position(0).truncate(0);
  			sync();
  		} catch (Exception e) {
  			log.error("Exception in clear()", e);
  		}
  	}
docs: Truncate file