コード例 #1
0
        public void DefaultConstructorCreatesAllZeros()
        {
#pragma warning disable SA1129 // Do not use default value type constructor
            var v = new ReadOnlyFixedBytes();
#pragma warning restore SA1129 // Do not use default value type constructor
            var bytes = v.ToByteArray();
            Assert.True(bytes.All(b => b == 0));
        }
コード例 #2
0
        /// <summary>
        ///     Gets the value packed in a byte array.
        /// </summary>
        public byte[] ToByteArray()
        {
            Contract.Requires(Length > 0);

            return(_bytes.ToByteArray(Length));
        }