Class SharedOutputBuffer

java.lang.Object
org.apache.http.nio.util.ExpandableBuffer
org.apache.http.nio.util.SharedOutputBuffer
All Implemented Interfaces:
BufferInfo, BufferInfo, ContentOutputBuffer

@Contract(threading=SAFE_CONDITIONAL) public class SharedOutputBuffer extends ExpandableBuffer implements ContentOutputBuffer
Implementation of the ContentOutputBuffer interface that can be shared by multiple threads, usually the I/O dispatch of an I/O reactor and a worker thread.

The I/O dispatch thread is expected to transfer data from the buffer to ContentEncoder by calling produceContent(ContentEncoder).

The worker thread is expected to write data to the buffer by calling write(int), write(byte[], int, int) or writeCompleted()

In case of an abnormal situation or when no longer needed the buffer must be shut down using shutdown() method.

Since:
4.0