// Create a new workbook Workbook workbook = new Workbook(); InputStream fileStream = this.getResourceStream("json/FormatString.ssjson"); workbook.fromJson(fileStream); // Create a ssjson file stream FileOutputStream outputStream = null; try { outputStream = new FileOutputStream("FormatString.ssjson"); } catch (FileNotFoundException e) { e.printStackTrace(); } workbook.toJson(outputStream); // Close the ssjson stream try { outputStream.close(); } catch (IOException e) { e.printStackTrace(); }
// Create a new workbook var workbook = Workbook() val fileStream = this.getResourceStream("json/FormatString.ssjson") workbook.fromJson(fileStream!!) // Create a ssjson file stream FileOutputStream("FormatString.ssjson").use { outputStream -> workbook.toJson(outputStream) // Close the ssjson stream }