Example usage for io.netty.buffer EmptyByteBuf hasMemoryAddress

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

Introduction

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

Prototype

@Override
    public boolean hasMemoryAddress() 

Source Link

Usage

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

License:Apache License

@Test
public void testMemoryAddress() {
    EmptyByteBuf empty = new EmptyByteBuf(UnpooledByteBufAllocator.DEFAULT);
    if (empty.hasMemoryAddress()) {
        assertThat(empty.memoryAddress(), is(not(0L)));
    } else {/*from w  w  w .  ja v a 2 s .  c  o m*/
        try {
            empty.memoryAddress();
            fail();
        } catch (UnsupportedOperationException ignored) {
            // Ignore.
        }
    }
}