Class SharedInputBuffer
- java.lang.Object
-
- org.apache.http.nio.util.ExpandableBuffer
-
- org.apache.cxf.transport.http.asyncclient.SharedInputBuffer
-
- All Implemented Interfaces:
org.apache.http.io.BufferInfo,org.apache.http.nio.util.BufferInfo
public class SharedInputBuffer extends org.apache.http.nio.util.ExpandableBufferContent 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 expect to transfer data fromContentDecoderto the buffer by calling#consumeContent(ContentDecoder). The worker thread is expected to read the data from the buffer by callingread()orread(byte[], int, int)methods. In case of an abnormal situation or when no longer needed the buffer must be shut down usingshutdown()method.
-
-
Constructor Summary
Constructors Constructor Description SharedInputBuffer(int buffersize, org.apache.http.nio.util.ByteBufferAllocator allocator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intavailable()intcapacity()voidclose()intconsumeContent(org.apache.http.nio.ContentDecoder decoder, org.apache.http.nio.IOControl ioc)booleanhasData()protected booleanisEndOfStream()protected booleanisShutdown()intlength()intread()intread(byte[] b)intread(byte[] b, int off, int len)voidreset()voidshutdown()protected voidwaitForData(int waitPos)
-
-
-
Method Detail
-
reset
public void reset()
-
consumeContent
public int consumeContent(org.apache.http.nio.ContentDecoder decoder, org.apache.http.nio.IOControl ioc) throws IOException- Throws:
IOException
-
hasData
public boolean hasData()
- Overrides:
hasDatain classorg.apache.http.nio.util.ExpandableBuffer
-
available
public int available()
- Specified by:
availablein interfaceorg.apache.http.io.BufferInfo- Specified by:
availablein interfaceorg.apache.http.nio.util.BufferInfo- Overrides:
availablein classorg.apache.http.nio.util.ExpandableBuffer
-
capacity
public int capacity()
- Specified by:
capacityin interfaceorg.apache.http.io.BufferInfo- Specified by:
capacityin interfaceorg.apache.http.nio.util.BufferInfo- Overrides:
capacityin classorg.apache.http.nio.util.ExpandableBuffer
-
length
public int length()
- Specified by:
lengthin interfaceorg.apache.http.io.BufferInfo- Specified by:
lengthin interfaceorg.apache.http.nio.util.BufferInfo- Overrides:
lengthin classorg.apache.http.nio.util.ExpandableBuffer
-
waitForData
protected void waitForData(int waitPos) throws IOException- Throws:
IOException
-
close
public void close()
-
shutdown
public void shutdown()
-
isShutdown
protected boolean isShutdown()
-
isEndOfStream
protected boolean isEndOfStream()
-
read
public int read() throws IOException- Throws:
IOException
-
read
public int read(byte[] b, int off, int len) throws IOException- Throws:
IOException
-
read
public int read(byte[] b) throws IOException- Throws:
IOException
-
-