BufferedOutputRange is a performance enhancement over writing directly to an output stream. It holds a File open for write or an OutputRange. Ouput is accumulated in an internal buffer and written to the output stream as a block.
Writing to stdout is a key use case. BufferedOutputRange is often dramatically faster than writing to stdout directly. This is especially noticable for outputs with short lines, as it blocks many writes together in a single write.
The internal buffer is written to the output stream after flushSize has been reached. This is checked at newline boundaries, when appendln is called or when put is called with a single newline character. Other writes check maxSize, which is used to avoid runaway buffers.
A destructor is present on this object, but not explicitly documented in the source.
BufferedOutputRange has a put method allowing it to be used a range. It has a number of other methods providing additional control.
The internal buffer is automatically flushed when the BufferedOutputRange goes out of scope.