code: public static void writeBufferToFile(String path, byte[] buffer) throws IOException {
      try (FileOutputStream os = new FileOutputStream(path)) {
        os.write(buffer);
      }
    }
docs: Writes buffer to the given file path.
  
  @param path file path to write the data
  @param buffer raw data