Top Fields Constructors Methods
org.apache.hc.core5.http.nio.support.classic

public final Class SharedOutputBuffer

extends AbstractSharedBuffer
implements ContentOutputBuffer
Class Inheritance
All Implemented Interfaces
org.apache.hc.core5.http.nio.support.classic.ContentOutputBuffer
Annotations
@Contract
threading:SAFE
Imports
java.io.IOException, .InterruptedIOException, java.nio.ByteBuffer, java.util.concurrent.locks.ReentrantLock, org.apache.hc.core5.annotation.Contract, .ThreadingBehavior, org.apache.hc.core5.http.nio.DataStreamChannel

Since
5.0

Field Summary

Modifier and TypeField and Description
private volatile DataStreamChannel
private volatile boolean
private volatile boolean
Inherited from org.apache.hc.core5.http.nio.support.classic.AbstractSharedBuffer:
abortedconditionendStreamlock

Constructor Summary

AccessConstructor and Description
public
SharedOutputBuffer(final ReentrantLock lock, final int initialBufferSize)

public
SharedOutputBuffer(final int bufferSize)

Method Summary

Modifier and TypeMethod and Description
private void
public void
flush(final DataStreamChannel channel)

private void
private void
public void
write(final byte[]
the data.
b
,
final int
the start offset in the data.
off
,
final int
the number of bytes to write.
len
)

Implements org.apache.hc.core5.http.nio.support.classic.ContentOutputBuffer.write.

Writes len bytes from the specified byte array starting at offset off to this buffer.
public void
write(final int
the byte.
b
)

Implements org.apache.hc.core5.http.nio.support.classic.ContentOutputBuffer.write.

Writes the specified byte to this buffer.
public void
Inherited from org.apache.hc.core5.http.nio.support.classic.AbstractSharedBuffer:
abortcapacityhasDataisEndStreamlengthreset

Field Detail

dataStreamChannelback to summary
private volatile DataStreamChannel dataStreamChannel
endStreamPropagatedback to summary
private volatile boolean endStreamPropagated
hasCapacityback to summary
private volatile boolean hasCapacity

Constructor Detail

SharedOutputBufferback to summary
public SharedOutputBuffer(final ReentrantLock lock, final int initialBufferSize)
SharedOutputBufferback to summary
public SharedOutputBuffer(final int bufferSize)

Method Detail

ensureNotAbortedback to summary
private void ensureNotAborted() throws InterruptedIOException
flushback to summary
public void flush(final DataStreamChannel channel) throws IOException
propagateEndStreamback to summary
private void propagateEndStream() throws IOException
waitFlushback to summary
private void waitFlush() throws InterruptedIOException
writeback to summary
public void write(final byte[] b, final int off, final int len) throws IOException

Implements org.apache.hc.core5.http.nio.support.classic.ContentOutputBuffer.write.

Doc from org.apache.hc.core5.http.nio.support.classic.ContentOutputBuffer.write.

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.

Parameters
b:byte[]

the data.

off:int

the start offset in the data.

len:int

the number of bytes to write.

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs.
writeback to summary
public void write(final int b) throws IOException

Implements org.apache.hc.core5.http.nio.support.classic.ContentOutputBuffer.write.

Doc from org.apache.hc.core5.http.nio.support.classic.ContentOutputBuffer.write.

Writes the specified byte to this buffer.

Parameters
b:int

the byte.

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs.
writeCompletedback to summary
public void writeCompleted() throws IOException

Implements org.apache.hc.core5.http.nio.support.classic.ContentOutputBuffer.writeCompleted.

Doc from org.apache.hc.core5.http.nio.support.classic.ContentOutputBuffer.writeCompleted.

Indicates the content has been fully written.

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs.