Datadog interview question

Code question: BufferedFile Writer, when buffer is full, flush data into file