Example usage for io.netty.buffer EmptyByteBuf internalNioBuffer

List of usage examples for io.netty.buffer EmptyByteBuf internalNioBuffer

Introduction

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

Prototype

@Override
    public ByteBuffer internalNioBuffer(int index, int length) 

Source Link

Usage

From source file:io.netty.buffer.EmptyByteBufTest.java

License:Apache License

@Test
public void testNioBuffer() {
    EmptyByteBuf empty = new EmptyByteBuf(UnpooledByteBufAllocator.DEFAULT);
    assertThat(empty.nioBufferCount(), is(1));
    assertThat(empty.nioBuffer().position(), is(0));
    assertThat(empty.nioBuffer().limit(), is(0));
    assertThat(empty.nioBuffer(), is(sameInstance(empty.nioBuffer())));
    assertThat(empty.nioBuffer(), is(sameInstance(empty.internalNioBuffer(0, 0))));
}