Example usage for io.netty.channel ChannelOutboundBuffer remove

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

Introduction

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

Prototype

public boolean remove() 

Source Link

Document

Will remove the current message, mark its ChannelPromise as success and return true .

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 . ja  v  a2  s.  c o  m*/
    while (!stream.isNotWritable() && (chunk = (ByteBuf) in.current()) != null) {
        bytesWritten += chunk.readableBytes();
        stream.writeData(chunk.retain(), false);
        stream.handlerContext.flush();
        in.remove();
    }
}