Class ByteBufferWriter

All Implemented Interfaces:
Closeable, Flushable, Appendable, AutoCloseable

An Writer that encodes the data written to it and stores it in a ByteBuffer obtained from a queue.

When a byte buffer is full, an Output event (default) is generated and a new buffer is fetched from the queue.

The function of this class can also be achieved by wrapping a ByteBufferOutputStream in a OutputStreamWriter. The major advantage of this class is that it drops the IOExceptions (which cannot happen) from the methods. Besides, it should be more resource efficient.