java.lang.Object | ||
↳ | org.apache.http.nio.util.ExpandableBuffer | |
↳ | org.apache.http.nio.util.SharedOutputBuffer |
Implementation of the 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.
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.apache.http.nio.util.ExpandableBuffer
|
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.apache.http.nio.util.ExpandableBuffer
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Returns available capacity of this buffer.
| |||||||||||
Returns the total capacity of this buffer.
| |||||||||||
Determines if the buffer contains data.
| |||||||||||
Returns the length of this buffer.
| |||||||||||
Writes content from this buffer to the given
ContentEncoder . | |||||||||||
Resets the buffer by clearing its state and stored content.
| |||||||||||
Writes the specified byte to this buffer.
| |||||||||||
Writes
len bytes from the specified byte array
starting at offset off to this buffer. | |||||||||||
Indicates the content has been fully written.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.apache.http.nio.util.ExpandableBuffer
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
org.apache.http.io.BufferInfo
| |||||||||||
From interface
org.apache.http.nio.util.BufferInfo
| |||||||||||
From interface
org.apache.http.nio.util.ContentOutputBuffer
|
Returns available capacity of this buffer.
Returns the total capacity of this buffer.
Determines if the buffer contains data.
true
if there is data in the buffer,
false
otherwise.
Returns the length of this buffer.
Writes content from this buffer to the given ContentEncoder
.
encoder | content encoder. |
---|
IOException |
---|
Resets the buffer by clearing its state and stored content.
Writes len
bytes from the specified byte array
starting at offset off
to this buffer.
If off
is negative, or len
is negative, or
off+len
is greater than the length of the array
b
, this method can throw a runtime exception. The exact type
of runtime exception thrown by this method depends on implementation.
b | the data. |
---|---|
off | the start offset in the data. |
len | the number of bytes to write. |
IOException |
---|