public static void setLength(Path path, long size) {
    try (var fc = FileChannel.open(path, CREATE, WRITE)) {
      int written = fc.write(ByteBuffer.allocate(1), size - 1);
      if (written != 1) {
        throw new IOException("Unable to expand " + path + " to " + size);
      }
    } catch (IOException e) {
      throw new UncheckedIOException(e);
    }
  }
Expands the file at {@code path} to {@code size} bytes.
planetiler-core/src/main/java/com/onthegomap/planetiler/util/FileUtils.java