Example usage for io.netty.channel ChannelOutboundBuffer current

List of usage examples for io.netty.channel ChannelOutboundBuffer current

Introduction

In this page you can find the example usage for io.netty.channel ChannelOutboundBuffer current.

Prototype

public Object current() 

Source Link

Document

Return the current message to write or null if nothing was flushed before and so is ready to be written.

Usage

From source file:io.vertx.core.http.impl.FileStreamChannel.java

License:Open Source License

@Override
protected void doWrite(ChannelOutboundBuffer in) throws Exception {
    ByteBuf chunk;//from w  w  w. j  a  va2  s .c om
    while (!stream.isNotWritable() && (chunk = (ByteBuf) in.current()) != null) {
        bytesWritten += chunk.readableBytes();
        stream.writeData(chunk.retain(), false);
        stream.handlerContext.flush();
        in.remove();
    }
}