protected unsafe override IByteBuffer NewDirectBuffer(int initialCapacity, int maxCapacity) { PoolThreadCache <byte[]> cache = this.threadCache.Value; PoolArena <byte[]> directArena = cache.DirectArena; IByteBuffer buf; if (directArena != null) { buf = directArena.Allocate(cache, initialCapacity, maxCapacity); } else { buf = UnsafeByteBufferUtil.NewUnsafeDirectByteBuffer(this, initialCapacity, maxCapacity); } return(ToLeakAwareBuffer(buf)); }