Пример #1
0
        public CompositeByteBuffer(IByteBufferAllocator allocator, int maxNumComponents)
            : base(int.MaxValue)
        {
            Contract.Requires(allocator != null);
            Contract.Requires(maxNumComponents >= 2);

            this.allocator        = allocator;
            this.maxNumComponents = maxNumComponents;
            this.leak             = LeakDetector.Open(this);
        }
Пример #2
0
        public CompositeByteBuffer(IByteBufferAllocator allocator, int maxNumComponents)
            : base(AbstractByteBufferAllocator.DefaultMaxCapacity)
        {
            Contract.Requires(allocator != null);
            Contract.Requires(maxNumComponents >= 2);

            this.allocator        = allocator;
            this.maxNumComponents = maxNumComponents;
            this.leak             = LeakDetector.Open(this);
        }
Пример #3
0
        public CompositeByteBuffer(IByteBufferAllocator allocator, int maxNumComponents, IByteBuffer[] buffers, int offset, int length)
            : base(AbstractByteBufferAllocator.DefaultMaxCapacity)
        {
            Contract.Requires(allocator != null);
            Contract.Requires(maxNumComponents >= 2);

            this.allocator        = allocator;
            this.maxNumComponents = maxNumComponents;
            this.AddComponents0(0, buffers, offset, length);
            this.ConsolidateIfNeeded();
            this.SetIndex(0, this.Capacity);
            this.leak = LeakDetector.Open(this);
        }
Пример #4
0
        public CompositeByteBuffer(
            IByteBufferAllocator allocator, int maxNumComponents, IEnumerable <IByteBuffer> buffers)
            : base(int.MaxValue)
        {
            Contract.Requires(allocator != null);
            Contract.Requires(maxNumComponents >= 2);

            this.allocator        = allocator;
            this.maxNumComponents = maxNumComponents;
            this.AddComponents0(0, buffers);
            this.ConsolidateIfNeeded();
            this.SetIndex(0, this.Capacity);
            this.leak = LeakDetector.Open(this);
        }