Example usage for io.netty.buffer EmptyByteBuf memoryAddress

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

Introduction

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

Prototype

@Override
    public long memoryAddress() 

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 ww .  j a v  a 2s.  c  o  m*/
        try {
            empty.memoryAddress();
            fail();
        } catch (UnsupportedOperationException ignored) {
            // Ignore.
        }
    }
}