Java Code Examples for io.netty.buffer.ByteBuf.nioBufferCount()

The following are Jave code examples for showing how to use nioBufferCount() of the io.netty.buffer.ByteBuf class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: kcp-netty   File: UkcpClientUdpChannel.java   Source Code and License Vote up 2 votes
/**
 * Checks if the specified buffer is a direct buffer and is composed of a single NIO buffer.
 * (We check this because otherwise we need to make it a non-composite buffer.)
 */
private static boolean isSingleDirectBuffer(ByteBuf buf) {
    return buf.isDirect() && buf.nioBufferCount() == 1;
}
 
Example 2
Project: kcp-netty   File: UkcpServerChannel.java   Source Code and License Vote up 2 votes
/**
 * Checks if the specified buffer is a direct buffer and is composed of a single NIO buffer.
 * (We check this because otherwise we need to make it a non-composite buffer.)
 */
private static boolean isSingleDirectBuffer(ByteBuf buf) {
    return buf.isDirect() && buf.nioBufferCount() == 1;
}