Class FastBufferedOutputStream

java.lang.Object
java.io.OutputStream
java.io.FilterOutputStream
org.jline.utils.FastBufferedOutputStream
All Implemented Interfaces:
Closeable, Flushable, AutoCloseable

public class FastBufferedOutputStream extends FilterOutputStream
A simple, non-synchronized buffered output stream for improved performance.

The FastBufferedOutputStream class provides a buffered output stream implementation that improves performance by reducing the number of calls to the underlying output stream. Unlike the standard BufferedOutputStream, this implementation does not include synchronization, making it faster but not thread-safe.

This class is particularly useful in single-threaded contexts where the overhead of synchronization is unnecessary. It uses a fixed-size buffer (8192 bytes) to collect written data before flushing it to the underlying output stream.

Key features include:

  • No synchronization overhead for improved performance
  • Fixed-size buffer to reduce system calls
  • Compatible with the standard OutputStream API

Note that this class is not thread-safe and should not be used in multi-threaded contexts without external synchronization.