Esempio n. 1
0
        /// <summary>
        ///     Initializes a new instance of the <see cref="ContentHash" /> struct from binary reader
        /// </summary>
        public ContentHash(BinaryReader reader)
        {
            Contract.Requires(reader != null);

            _hashType = (HashType)reader.ReadByte();
            _bytes    = ReadOnlyFixedBytes.ReadFrom(reader);
        }
Esempio n. 2
0
        /// <summary>
        ///     Initializes a new instance of the <see cref="ContentHash" /> struct from binary reader
        /// </summary>
        public ContentHash(HashType hashType, BinaryReader reader)
            : this()
        {
            Contract.Requires(hashType != HashType.Unknown);
            Contract.Requires(reader != null);

            _hashType = hashType;
            _bytes    = ReadOnlyFixedBytes.ReadFrom(reader, ByteLength);
        }