Skip to content

Instantly share code, notes, and snippets.

@grkvlt
Created October 15, 2017 20:04
Show Gist options
  • Save grkvlt/c3df558276d1d005695cb93d25cb306e to your computer and use it in GitHub Desktop.
Save grkvlt/c3df558276d1d005695cb93d25cb306e to your computer and use it in GitHub Desktop.
Exploring Iterated Function Systems
public static void save(IFS ifs, File file) {
try (FileWriter writer = new FileWriter(file)) {
JAXBContext context = JAXBContext.newInstance(IFS.class);
Marshaller marshaller = context.createMarshaller();
marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
marshaller.marshal(ifs, writer);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment