@ThreadSafe
public class SharedOutputBuffer
extends org.apache.http.nio.util.ExpandableBuffer
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.Constructor and Description |
---|
SharedOutputBuffer(int buffersize,
org.apache.http.nio.util.ByteBufferAllocator allocator) |
Modifier and Type | Method and Description |
---|---|
int |
available() |
int |
capacity() |
void |
close() |
int |
copy(InputStream in) |
void |
flush() |
boolean |
hasData() |
int |
length() |
int |
produceContent(org.apache.http.nio.ContentEncoder encoder,
org.apache.http.nio.IOControl ioc) |
void |
reset() |
void |
shutdown() |
void |
write(byte[] b) |
void |
write(byte[] b,
int off,
int len) |
int |
write(ByteBuffer b) |
void |
write(int b) |
void |
writeCompleted() |
public SharedOutputBuffer(int buffersize, org.apache.http.nio.util.ByteBufferAllocator allocator)
public void reset()
public boolean hasData()
hasData
in class org.apache.http.nio.util.ExpandableBuffer
public int available()
available
in interface org.apache.http.nio.util.BufferInfo
available
in class org.apache.http.nio.util.ExpandableBuffer
public int capacity()
capacity
in interface org.apache.http.nio.util.BufferInfo
capacity
in class org.apache.http.nio.util.ExpandableBuffer
public int length()
length
in interface org.apache.http.nio.util.BufferInfo
length
in class org.apache.http.nio.util.ExpandableBuffer
public int produceContent(org.apache.http.nio.ContentEncoder encoder, org.apache.http.nio.IOControl ioc) throws IOException
IOException
public void close()
public void shutdown()
public int copy(InputStream in) throws IOException
IOException
public void write(byte[] b, int off, int len) throws IOException
IOException
public int write(ByteBuffer b) throws IOException
IOException
public void write(byte[] b) throws IOException
IOException
public void write(int b) throws IOException
IOException
public void flush() throws IOException
IOException
public void writeCompleted() throws IOException
IOException
Apache CXF