Example usage for io.netty.handler.stream ChunkedFile ChunkedFile

List of usage examples for io.netty.handler.stream ChunkedFile ChunkedFile

Introduction

In this page you can find the example usage for io.netty.handler.stream ChunkedFile ChunkedFile.

Prototype

public ChunkedFile(RandomAccessFile file, int chunkSize) throws IOException 

Source Link

Document

Creates a new instance that fetches data from the specified file.

Usage

From source file:com.king.platform.net.http.netty.request.ChunkedFileHttpBody.java

License:Apache License

@Override
public ChannelFuture writeContent(ChannelHandlerContext ctx) throws IOException {
    Channel channel = ctx.channel();

    return channel.write(new ChunkedFile(file, 1024 * 8), channel.newProgressivePromise());

}