-
-
Save kasramp/80a6256156aeed414180c2d1aa6cd172 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val file = File("students.json") | |
val fileWriter = FileWriter(file, true) | |
val sequenceWriter = objectMapper.writerWithDefaultPrettyPrinter().writeValuesAsArray(fileWriter) | |
var pageNumber = 0 | |
do { | |
val result = getStudentsDetailsByPage(pageNumber) | |
sequenceWriter.writeAll(result.content) | |
pageNumber += 1 | |
} while (result.hasNext()) | |
sequenceWriter.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I am adopting this concept to append to end of my json array but would like to know where getStudentDetailsByPage() is coming from.
My implementation append outside the array and never closes the ']'.