Class SharedOutputBuffer
java.lang.Object
org.apache.hc.core5.http.impl.nio.ExpandableBuffer
org.apache.cxf.transport.http.asyncclient.hc5.SharedOutputBuffer
public class SharedOutputBuffer
extends org.apache.hc.core5.http.impl.nio.ExpandableBuffer
Content buffer 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
DataStreamChannel by calling produceContent(DataStreamChannel).
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.-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.hc.core5.http.impl.nio.ExpandableBuffer
org.apache.hc.core5.http.impl.nio.ExpandableBuffer.Mode -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintcapacity()voidclose()intcopy(InputStream in) voidflush()booleanhasData()intlength()intproduceContent(org.apache.hc.core5.http.nio.DataStreamChannel stream) voidreset()voidshutdown()voidwrite(byte[] b) voidwrite(byte[] b, int off, int len) voidwrite(int b) intwrite(ByteBuffer b) voidMethods inherited from class org.apache.hc.core5.http.impl.nio.ExpandableBuffer
buffer, clear, ensureAdjustedCapacity, ensureCapacity, expand, mode, setInputMode, setOutputMode, toString
-
Constructor Details
-
SharedOutputBuffer
public SharedOutputBuffer(int buffersize)
-
-
Method Details
-
reset
public void reset() -
hasData
public boolean hasData()- Overrides:
hasDatain classorg.apache.hc.core5.http.impl.nio.ExpandableBuffer
-
capacity
public int capacity()- Overrides:
capacityin classorg.apache.hc.core5.http.impl.nio.ExpandableBuffer
-
length
public int length()- Overrides:
lengthin classorg.apache.hc.core5.http.impl.nio.ExpandableBuffer
-
produceContent
- Throws:
IOException
-
close
public void close() -
shutdown
public void shutdown() -
copy
- Throws:
IOException
-
write
- Throws:
IOException
-
write
- Throws:
IOException
-
write
- Throws:
IOException
-
write
- Throws:
IOException
-
flush
- Throws:
IOException
-
writeCompleted
- Throws:
IOException
-