public class SharedOutputBuffer
extends org.apache.http.nio.util.ExpandableBuffer
ContentEncoder by calling produceContent(ContentEncoder, IOControl).
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.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.ExpandableBufferpublic int produceContent(org.apache.http.nio.ContentEncoder encoder,
org.apache.http.nio.IOControl ioc)
throws IOException
IOExceptionpublic void close()
public void shutdown()
public int copy(InputStream in) throws IOException
IOExceptionpublic void write(byte[] b,
int off,
int len)
throws IOException
IOExceptionpublic int write(ByteBuffer b) throws IOException
IOExceptionpublic void write(byte[] b)
throws IOException
IOExceptionpublic void write(int b)
throws IOException
IOExceptionpublic void flush()
throws IOException
IOExceptionpublic void writeCompleted()
throws IOException
IOExceptionApache CXF