Back to problems

Design a Buffered File Writer

Object-Oriented Programming · Datadog · Medium

A logging system sends raw bytes to disk through a supplied File object. Because issuing many small writes can be inefficient, create an in-memory buffering layer that groups data before sending it to disk. Design a class BufferedFile that retains bytes in memory and writes them to disk when a flush is required. The provided File API is: Implement the BufferedFile class: void BufferedFile(int bufferSize) Create an instance using the single parameter bufferSize. void…

Checking your access…