code: public static void write(final byte[] data, final Path path) throws IOException {
          try (final SafeOutputStream out = createAtomicFile(path)) {
              out.write(ByteBuffer.wrap(data));
              out.commit();
          }
      }
docs: Write the bytes to a temporary file, fsync the file, then atomically rename to the target path.
  On error it will make a best-effort to erase the temporary file.
  
  @param data binary value to write to file
  @param path path to write out to
  @throws IOException in the event that the data could not be written to the path.