Top Description Methods
org.apache.hc.core5.http.nio

public Interface DataStreamChannel

extends StreamChannel<ByteBuffer>
Annotations
@Contract
threading:SAFE
Imports
java.io.IOException, java.nio.ByteBuffer, java.util.List, org.apache.hc.core5.annotation.Contract, .ThreadingBehavior, org.apache.hc.core5.http.Header

Abstract byte stream channel

Implementations are expected to be thread-safe.

Since
5.0

Method Summary

Modifier and TypeMethod and Description
public void
endStream(List<? extends Header> trailers)

Terminates the underlying data stream and optionally writes a closing sequence with the given trailers.

public void
requestOutput()

Signals intent by the data producer to produce more data.

public int

Returns:

The number of bytes written, possibly zero
write
(ByteBuffer
source of data
src
)

Redeclares org.apache.hc.core5.http.nio.StreamChannel.write.

Writes data from the buffer through this channel into the underlying byte stream.
Inherited from org.apache.hc.core5.http.nio.StreamChannel:
endStream

Method Detail

endStreamback to summary
public void endStream(List<? extends Header> trailers) throws IOException

Terminates the underlying data stream and optionally writes a closing sequence with the given trailers.

Please note that some data streams may not support trailers and may silently ignore the trailers parameter.

requestOutputback to summary
public void requestOutput()

Signals intent by the data producer to produce more data. Once the channel is able to accept data its handler is expected to trigger an event to notify the data producer.

writeback to summary
public int write(ByteBuffer src) throws IOException

Redeclares org.apache.hc.core5.http.nio.StreamChannel.write.

Writes data from the buffer through this channel into the underlying byte stream. If the underlying byte stream is temporarily unable to accept more data it can return zero to indicate that no data could be written to the data stream. The data producer can choose to call requestOutput() to signal its intent to produce more data.

Parameters
src:ByteBuffer

source of data

Returns:int

The number of bytes written, possibly zero

Annotations
@Override