code: public static void dumpNumberToFile(final Path filePath, final long num) throws IOException {
      try (final BufferedWriter writer = Files
          .newBufferedWriter(filePath, StandardCharsets.UTF_8)) {
        writer.write(String.valueOf(num));
      } catch (final IOException e) {
        log.error("Failed to write the number {} to the file {}", num, filePath, e);
        throw e;
      }
    }
docs: Dumps a number into a new file.
  
  @param filePath the target file
  @param num the number to dump
  @throws IOException if file already exists