Example #1
0
        BlobChunkVerificationResultInfo VerifyStart(bool streamFirst = true)
        {
            var result = streamFirst ? VerifyEnoughBytesForChunkOrData(kHeaderSize) : BlobChunkVerificationResultInfo.ValidResult;

            if (result.IsValid)
            {
                if (streamFirst)
                {
                    UnderlyingStream.Stream(ref mHeader);
                }

                bool requires_byteswap;
                result = mHeader.Verify(out requires_byteswap);

                if (result.IsValid && requires_byteswap)
                {
                    UnderlyingStream.ChangeByteOrder(UnderlyingStream.ByteOrder.Invert());
                }
            }

            if (result.IsInvalid)
            {
                result.Context = BlobChunkVerificationResultContext.Header;
            }

            return(result);
        }