@Contract(threading=SAFE_CONDITIONAL)
public class NhttpSharedOutputBuffer
extends org.apache.http.nio.util.ExpandableBuffer
implements org.apache.http.nio.util.ContentOutputBuffer
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.
Please note that SharedOutputBuffer class was copied here renamed as
NhttpSharedOutputBuffer from httpcore-nio in order to fix
https://github.com/wso2/product-ei/issues/1367, without having to do an API change in httpcore-nio component.
| Constructor and Description |
|---|
NhttpSharedOutputBuffer(int buffersize) |
NhttpSharedOutputBuffer(int buffersize,
org.apache.http.nio.util.ByteBufferAllocator allocator) |
NhttpSharedOutputBuffer(int buffersize,
org.apache.http.nio.IOControl ioctrl,
org.apache.http.nio.util.ByteBufferAllocator allocator)
Deprecated.
|
NhttpSharedOutputBuffer(int buffersize,
org.apache.http.nio.IOControl ioctrl,
org.apache.http.nio.util.ByteBufferAllocator allocator,
int timeout) |
| Modifier and Type | Method and Description |
|---|---|
int |
available() |
int |
capacity() |
void |
close() |
void |
flush() |
boolean |
hasData() |
int |
length() |
int |
produceContent(org.apache.http.nio.ContentEncoder encoder)
Deprecated.
|
int |
produceContent(org.apache.http.nio.ContentEncoder encoder,
org.apache.http.nio.IOControl ioctrl) |
void |
reset() |
void |
shutdown() |
void |
write(byte[] b) |
void |
write(byte[] b,
int off,
int len) |
void |
write(int b) |
void |
writeCompleted() |
public NhttpSharedOutputBuffer(int buffersize,
org.apache.http.nio.IOControl ioctrl,
org.apache.http.nio.util.ByteBufferAllocator allocator,
int timeout)
@Deprecated
public NhttpSharedOutputBuffer(int buffersize,
org.apache.http.nio.IOControl ioctrl,
org.apache.http.nio.util.ByteBufferAllocator allocator)
public NhttpSharedOutputBuffer(int buffersize,
org.apache.http.nio.util.ByteBufferAllocator allocator)
public NhttpSharedOutputBuffer(int buffersize)
public void reset()
reset in interface org.apache.http.nio.util.ContentOutputBufferpublic boolean hasData()
hasData in class org.apache.http.nio.util.ExpandableBufferpublic int available()
available in interface org.apache.http.nio.util.BufferInfoavailable in class org.apache.http.nio.util.ExpandableBufferpublic int capacity()
capacity in interface org.apache.http.nio.util.BufferInfocapacity in class org.apache.http.nio.util.ExpandableBufferpublic int length()
length in interface org.apache.http.nio.util.BufferInfolength in class org.apache.http.nio.util.ExpandableBuffer@Deprecated
public int produceContent(org.apache.http.nio.ContentEncoder encoder)
throws java.io.IOException
produceContent in interface org.apache.http.nio.util.ContentOutputBufferjava.io.IOExceptionpublic int produceContent(org.apache.http.nio.ContentEncoder encoder,
org.apache.http.nio.IOControl ioctrl)
throws java.io.IOException
java.io.IOExceptionpublic void close()
public void shutdown()
public void write(byte[] b,
int off,
int len)
throws java.io.IOException
write in interface org.apache.http.nio.util.ContentOutputBufferjava.io.IOExceptionpublic void write(byte[] b)
throws java.io.IOException
java.io.IOExceptionpublic void write(int b)
throws java.io.IOException
write in interface org.apache.http.nio.util.ContentOutputBufferjava.io.IOExceptionpublic void flush()
throws java.io.IOException
flush in interface org.apache.http.nio.util.ContentOutputBufferjava.io.IOExceptionpublic void writeCompleted()
throws java.io.IOException
writeCompleted in interface org.apache.http.nio.util.ContentOutputBufferjava.io.IOExceptionCopyright © 2005-2021 Apache Software Foundation. All Rights Reserved.