public interface FileChunkedStrategy<T>
NettyOutbound when sending a file
should be done using a ChunkedInput instead of zero-copy (typically when SSL
is used). This in turn allows to manipulate the pipeline and adapt the exact ChunkedInput
used to different situation, like TCP vs HTTP.| Modifier and Type | Method and Description |
|---|---|
ChunkedInput<T> |
chunkFile(java.nio.channels.FileChannel fileChannel)
Given the sent file as a
RandomAccessFile, return a ChunkedInput
"view" of the file, eg. |
void |
cleanupPipeline(NettyContext context)
Once the file has been written, allows to clean the pipeline
(see
preparePipeline(NettyContext)) and do other operations. |
void |
preparePipeline(NettyContext context)
Allow for preparing the pipeline (eg.
|
void preparePipeline(NettyContext context)
NettyContext is provided and can be used to get the
channel() then pipeline().context - the context from which to obtain the channel and pipelineChunkedInput<T> chunkFile(java.nio.channels.FileChannel fileChannel)
RandomAccessFile, return a ChunkedInput
"view" of the file, eg. as a ChunkedFile or a
HttpChunkedInput around a ChunkedFile.fileChannel - the FileChannel for the file being sentChunkedInputvoid cleanupPipeline(NettyContext context)
preparePipeline(NettyContext)) and do other operations.context - the context from which to obtain the channel and pipeline