Skip to content

Instantly share code, notes, and snippets.

@sethdorris
Last active January 29, 2021 18:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sethdorris/e770b5e01386e815eb1a4d12af17d3b0 to your computer and use it in GitHub Desktop.
Save sethdorris/e770b5e01386e815eb1a4d12af17d3b0 to your computer and use it in GitHub Desktop.
Gson gson = new Gson();
String jsonOutput = gson.toJson(dataFile);
File jsonFile = new File("jsonoutput.json");
try (BufferedWriter br = new BufferedWriter(new FileWriter(jsonFile))) {
br.write(jsonOutput);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment