Ejemplo n.º 1
0
        internal static PooledHeapByteBuffer NewInstance(int maxCapacity)
        {
            PooledHeapByteBuffer buf = Recycler.Take();

            buf.Reuse(maxCapacity);
            return(buf);
        }
        internal static PooledHeapByteBuffer NewInstance(int maxCapacity)
        {
            PooledHeapByteBuffer buf = Recycler.Take();

            buf.SetReferenceCount(1); // todo: reuse method?
            buf.MaxCapacity = maxCapacity;
            buf.SetIndex(0, 0);
            buf.DiscardMarkers();
            return(buf);
        }
Ejemplo n.º 3
0
 protected override PooledByteBuffer <byte[]> NewByteBuf(int maxCapacity) =>
 PooledHeapByteBuffer.NewInstance(maxCapacity);