/// <summary>
        /// Fills length bytes memory with data.
        /// </summary>
        /// <param name="data">The byte to fill teh data.</param>
        /// <param name="length">The amount of bytes to fill.</param>
        public unsafe void Fill(byte data, int length)
        {
            if (length > size)
            {
                Next = new ManagedBinaryMemoryWriterSegment(writer, length > 1024 ? length : 1024);
                Next.Fill(data, length);
                return;
            }

            size -= length;

            if (length > 80)
            {
                ulong oData = ((ulong)data << 56) | ((ulong)data << 48) | ((ulong)data << 40) | ((ulong)data << 32) | ((ulong)data << 24) | ((ulong)data << 16) | ((ulong)data << 8) | (ulong)data;

                while (length > 7)
                {
                    fixed(byte *bData = this.data)
                    * (ulong *)(bData + position) = oData;

                    length   -= 8;
                    position += 8;
                }
            }

            while (length-- > 0)
            {
                this.data[position++] = data;
            }
        }
        /// <summary>
        /// Fills length bytes memory with random data.
        /// </summary>
        /// <param name="rng">The random number generator to use.</param>
        /// <param name="length">The amount of bytes to fill.</param>
        public void Fill(RNGCryptoServiceProvider rng, int length)
        {
            if (length > size)
            {
                Next = new ManagedBinaryMemoryWriterSegment(writer, length > 1024 ? length : 1024);
                Next.Fill(rng, length);
                return;
            }

            rng.GetBytes(data, position, length);

            position += length;
            size     -= length;
        }
        /// <summary>
        /// Fills length bytes memory with random data.
        /// </summary>
        /// <param name="rng">The random number generator to use.</param>
        /// <param name="length">The amount of bytes to fill.</param>
        public unsafe void Fill(Random rng, int length)
        {
            if (length > size)
            {
                Next = new ManagedBinaryMemoryWriterSegment(writer, length > 1024 ? length : 1024);
                Next.Fill(rng, length);
                return;
            }

            fixed(byte *bData = data)
            {
                for (; length >= 4; position += 4, size -= 4, length -= 4)
                {
                    *(int *)(bData + position) = rng.Next(int.MinValue, int.MaxValue);
                }

                for (; length >= 0; position++, size--, length--)
                {
                    *(int *)(bData + position) = (byte)rng.Next(256);
                }
            }
        }
 /// <summary>
 /// Fills length bytes memory with data.
 /// </summary>
 /// <param name="data">The byte to fill teh data.</param>
 /// <param name="length">The amount of bytes to fill.</param>
 public void Fill(byte data, int length)
 {
     currentSegment.Fill(data, length);
 }