Example usage for io.netty.buffer SlicedByteBuf SlicedByteBuf

List of usage examples for io.netty.buffer SlicedByteBuf SlicedByteBuf

Introduction

In this page you can find the example usage for io.netty.buffer SlicedByteBuf SlicedByteBuf.

Prototype

public SlicedByteBuf(ByteBuf buffer, int index, int length) 

Source Link

Usage

From source file:net.tomp2p.storage.AlternativeCompositeByteBuf.java

License:Apache License

@Override
public ByteBuf slice(int index, int length) {
    if (length == 0) {
        return Unpooled.EMPTY_BUFFER;
    }//  w  w w  .j  av  a  2s  . c  om

    return new SlicedByteBuf(this, index, length);
}