Exemple #1
0
            public Builder Reserve(int capacity)
            {
                if (capacity < 0)
                {
                    throw new ArgumentOutOfRangeException(nameof(capacity));
                }

                ValueBuffer.Reserve(BitUtility.ByteCount(capacity));
                return(this);
            }
Exemple #2
0
            public Builder Resize(int length)
            {
                if (length < 0)
                {
                    throw new ArgumentOutOfRangeException(nameof(length));
                }

                ValueBuffer.Resize(BitUtility.ByteCount(length));
                Length = length;
                return(this);
            }
Exemple #3
0
 /// <summary>
 /// Creates an instance of the <see cref="BitmapBuilder"/> class.
 /// </summary>
 /// <param name="capacity">Number of bits of initial capacity to reserve.</param>
 public BitmapBuilder(int capacity = DefaultBitCapacity)
 {
     Memory   = new byte[BitUtility.ByteCount(capacity)];
     Capacity = capacity;
 }