Example usage for io.netty.buffer EmptyByteBuf nioBuffer

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

Introduction

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

Prototype

@Override
    public ByteBuffer nioBuffer() 

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))));
}