@Override
  public FileChannel truncate(final long size) throws IOException {
    synchronized (this) {
      this.position = Math.min(position, size);
    }
    return fileChannelHandle.retryIfInterrupted(ch -> ch.truncate(size));
  }
@Override
  public FileChannel truncate(final long size)